I am trying to save an integer into a nullable int column only if there is a value
if (user.AssociationID != 0)
{
int? AssociationID = user.AssociationID;
currentUser.AssociationID == AssociationID;
}
I have tried casing currentUser into an int (int?)currentUser.AssociationID
I know this has to be terribly simple. I’ve googled for the title of the question and am not finding the results I need. Be nice, I’m a noob.
Error I’m getting:
Only assignment, call, increment, decrement, and new object expressions can be used as a statement
should be