Quantcast
Channel: Entity Framework
Viewing all articles
Browse latest Browse all 10318

Commented Issue: Using the designer to make a DbSet property non-public results in code generation that needs modification [648]

$
0
0
You can choose to make a DbSet property non-public, but once this happens the automatic initialization of the property by DbContext does not happen. (This is because we choose not to mess with properties that don't look like simple public automatic properties to avoid stomping on anything the context is doing explicitly.) But when using the DbContext templates we also don't generate code that using context.Set<> to initialize the property. The generated code can be modified (e.g. with partials) to overcome this, or indeed the template itself can be modified, but it would be nice if the generated code worked in this case without modification.
Comments: Fixed with #0af61d0. Also fixed accessibility of the NavProps which referenced the non-public entity at the same time.

Viewing all articles
Browse latest Browse all 10318

Trending Articles



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