Reputation: 2828
I am using a database first approach with sqlce 3.5 and entity framework. Next I am extending my generated (.edmx file) partial class with external partial class properties where I implementing business logic. These extra properties are not required to be stored in database. Is this correct solution to the problem or are there any other more adequate solutions ?
Upvotes: 1
Views: 610
Reputation: 44605
there is no black and white in general; in this case if you are using the partial classes properly so you add all your custom logic not to the auto-generated files from EF (edmx.cs...) but to other files in the same project, you can basically extend the Entities
or the ObjectContext
as you wish and you are free to regenerate any time when either database changes or you update the model in the designer.
I use this logic in general and more specifically I try to use the layering as I described here: https://stackoverflow.com/q/7474357/559144 and I make all layers except the DAL fully independent from the EF. hope this helps :)
Upvotes: 1