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

New Post: Is it possible to extend the Migration Scaffolding to generate code for a new attribute, like [Index]

$
0
0

Scott,

Not easily currently, but we are working on it and this is one of the core scenarios we want to enable.

The problem right now is that, although you can define your own annotation (as of EF6), it is still hard to flow ad hoc metadata (like the index metadata above) through to other parts of our stack (such as Migrations). The main reason it is tricky right now is that we still xml serialize our metadata in several parts of the stack and so any annotations made to the metadata need to roundtrip through our serializer, which it currently doesn't support. We are in the process of removing this serialization requirement in order to enable this kind of thing but we are still a few months away from having it all done.

An alternative would be to add this functionality directly as a core feature to EF. This is not something we are going to do for EF6, but is something we would definitely consider as a contribution from the community. I can provide detail on the changes required to implement this feature if you (or anyone else) wants to take this on.

Cheers,

Andrew.


Viewing all articles
Browse latest Browse all 10318

Trending Articles



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