I have an property in my class that i will make optional. Only probem is that the property is using Guid and is required as standard. I dont know how to make it nullable.
What im trying to accomplish is to extend the membershipprovider whit an new table, Groups, and make an one-to-many link between Group and Users.
The Property:
public virtual Guid GroupId { get; set; }
public virtual Group Group { get; set; }
So how can i make an Guid property nullable?
Make it
Nullable<Guid>, akaGuid?:If you haven’t come across nullable value types in C# before, you might want to read up on them.
(Do you really need the property to be virtual, btw? Are you expecting different implementations?)