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:
I want to be able to do this programmatically.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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