Answer the question
In order to leave comments, you need to log in
How to set a GUID for an object only if it is not set?
I'm using the Entity Framework and generating keys using a GUID, but it turns out that each time I access it, I generate a new ID. Property example:
public Guid id { get; set; } = Guid.NewGuid();
How to check that it is not null and only when set the property to null?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question