How to elemenate metadata from EntityConnction in EF 4.1 RRS feed

  • Question

  • Hi,

    We were using EF 4.0 or older version of entity framework where we used EntityConnection class.

    Now we migrate it to EF4.1 in which i need we dont need to use metadata.

    we have an requirement to remove the metadata because in EF4.1 metadata must not be used.

    Please guide me how can i remove these dependecy from our projects.




    Tuesday, September 6, 2011 11:47 AM

All replies

  • Hello,

    it is not true that EF 4.1 doesn't use metadata. How do you migrate to EF 4.1? Are you removing your EDMX files and rewriting your application to code first approach with mapping in code? If so you can simply delete EDMX files. But if you are not going to rewrite your mapping you must use EDMX = you must use metadata. Also are you going to move from ObjectContext to DbContext API? If yes you need to use DbContext Generator T4 template. If not you don't have to do anything because EF 4.1 didn't bring any change for ObjectContext + EDMX.

    Best regards,

    Tuesday, September 6, 2011 7:32 PM
  • Hi Ladislav,

    Thanks for the response.

    Actually i am using EntityConnection class as follows in my project (it has EF4.1).

    DataBaseSet _dbset = LogicalDatabaseManager.GetDatabase(OfficeModelContainer.ContainerName);

    EntityConnection_connection = new EntityConnection(_dbset.ProviderConnectionString);

    We got the response that EntityConnection class created using the metadata. since we are using EF4.1 metadata must not be used.

    I couldn't get the understanding which metadata EntityConnection used to create.




    • Edited by Shaunty Wednesday, September 7, 2011 7:19 AM
    Wednesday, September 7, 2011 7:15 AM
  • What are you migrating and what should be result of your migration? What API and what type of mapping are you using at the moment and what API and mapping are you going to use after migration? How big change should happen in your code and what is the purpose of the migration? Until you know answers to these question don't touch your code because your existing code will work without any change with "EF 4.1" because it will not use EF 4.1.

    Best regards,


    Wednesday, September 7, 2011 9:35 AM