g.pickardou
g.pickardou

Reputation: 35963

How can I automate that columns in my .edmx called 'Created' should have StoreGeneratedPattern 'Computed'?

I am using EF 6 with DB first (and POCO entity classes). I have a convention in my DB model that tables have a column called Created. This column got its default value at server side (GETDATE() in SQL Server) .

When I add or refresh my .edmx, for all new entities showing up in the schema I must manually set the Created attribute's StoreGeneratedPattern property to 'Computed'.

This does not sound a big deal, however it seems to me a productivity killer after in the last 5 years I did it zillon times.

So I decided to invest the time and automate this. I know how to manipulate the .edmx as XML or alternatively I also know that there dedicated C# classes to manipulate the object model. What are do not know:

Upvotes: 2

Views: 44

Answers (0)

Related Questions