Quantcast
Channel: entityframework Discussions Rss Feed
Viewing all articles
Browse latest Browse all 1793

New Post: PropertyChange at DbContext in EF 6

$
0
0
@leveloper If you want to have property change notifications in POCO entities when using Database First, then I think the best approach is to modify the T4 templates. It's unlikely that we will change the templates to have this built in because it is something that is not needed by many people. In general we try to keep the entities generated very simple and also keep the templates simple so that people can more easily edit them to add whatever they need. We have considered releasing multiple templates for different purposes or adding customization points to the templates but as of now this is not high on our priority list of things to do.

For question #3 the answer is, in general, no. The correct thing to do for Code First development is to use the EF 6.1 tooling to scaffold a Code First context and entities. The scaffolded code will include appropriate Code First mapping information which may be missing when using the approach you outlined. See http://blogs.msdn.com/b/adonet/archive/2014/03/17/ef6-1-0-rtm-available.aspx for details.

For #4 I don't know of any reasonable way to do this.

For #5 and #6 it is important to understand that the EDMX file used by the designer is the source of truth and is the artifact that should be edited. The generated classes are truly auto-generated and will always be automatically re-generated when the EDMX changes. The message box you mention is just Visual Studio asking if you want to see the re-generated file. Whether or not you look at it doesn't change the fact that is has been re-generated and will continue to be re-generated.

On the other hand, when you reverse engineer to Code First using the EF 6.1. tooling the code is generated once and then you are free to edit it. It will never be automatically re-generated again. For that you would need to run the reverse engineering wizard again. So is this respect reverse engineering to Code First may be a better option for you than Database First.

Viewing all articles
Browse latest Browse all 1793

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>