views:

32

answers:

1

I want to load EF metadata from database at runtime. Is that scenario possible? First get the data from database, then write it to .ssdl, .msl and .csdl files sounds ok. But how to tell EF to use what I've loaded? Do I need to compile it or something like that?

+1  A: 

Yes, you can do that.

New up a MetadataWorkspace using the constructor which takes these files.

Then you can new up an EntityConnection passing the MetadataWorkspace to the overloaded constructor, and finally new the ObjectContext passing that.

With all that said, I wonder if this is the best approach to your problem.

Craig Stuntz
thanks a lot for the advice
chester89