I want to implement the GUID as the primary key in my models. I use a model-first approach, and I want the GUID
to be generated not in the database, but in the .NET server.
I've seen a solution that said that I would have to do this for each class:
public class TestObject
{
public TestObject()
{
Id = Guid.NewGuid();
}
public Guid Id { get; set; }
}
The problem is that: I don't think this is a clean solution, applying this to every class I have.
And I don't have the POCO classes because I am using model-first.
So, what can I do? Is this the best approach, do you think? Any advice?