views:

151

answers:

1

How to add a FunctionImportMapping programmatically using classes from the System.Data.Entity.Design namespace?

This blog post discusses the modifications that need to be made to the EDMX:

http://blogs.msdn.com/adonet/archive/2007/09/14/how-to-map-stored-procedures-using-the-ado-net-entity-framework.aspx

I want to be able to do this programmatically.

+2  A: 

Unfortunately the metadata APIs (i.e. the ones that reason about the CSDL/MSL/SSDL) are read-only. So unless you write your own API to help you create appropriate XML, you are out of luck.

Hope this helps

Alex

Alex James
I figured. Thanks for confirming.
EF v4 will support "Code Only" EDMs that may be modifiable at runtime.
Dave Swersky
Well the EDM might be modifyable at runtime, the class upon which the model is based, are not. So you are limited to a sub-set of what your CLR classes define.
Alex James