Adult Trivípila 2010 TRAILER (Español Latino). Cartel de droga "El Chapo" Guzmán Loera, como lo conocerán más tarde el llamado "Jefe Más Alto" y el líder de Los Zetas, Rafael Caro Quintero y Édgar Valdez Villarreal.
Pablo, El Mas Loco, El Farsante, La Vendedora de Flores, El Mudo y La Muerte. Movida de Máscaras. Vino.DvdRip.Latino. Marcelino (2010) Dvdrip Latino.
Mariana Avina Forró, Marcelino La que detesta a Pedro. Usted me permitirá un vino con limonete y una golpiza. Marcelino (2010) Dvdrip Latino.Q:
How to store a value into a variable if one of the values of a property is a nullable type?
I have a class with a property that is an int?. When I attempt to use the int? property on the class, I would like to store a null into the property if one of the values is null. If I do it this way, I get a compiler error on the code because the int? type is a reference type.
I can do this by checking if the value is not null and then assigning a value if the property is null.
int? myInt = null;
myInt = 1;
This will store a value into myInt. I would prefer to be able to do the following instead:
int? myInt =?null;
myInt = 1;
However, I get a compiler error as shown below:
The member '?' has no supported translation to SQL.
From the error, I gather that C# can't assign a nullable int? to a field of type int, which is what I'm trying to do. If I try to cast the int? to an int, it doesn't assign the value either. How should I store a null value into the property if a nullable value can't be assigned to a property of a reference type?
I'd suggest simply casting the nullable to an int? and then setting it: