none
Multple edmx files for 1 Database RRS feed

  • Question

  • Would it be a bad idea to have multiple edmx files for the 1 database. So, 1 edmx file for the tables which correspond to a certain set of buisness operations.

    Would multiple contexts be problematic?

    Cheers

    Monday, August 29, 2011 3:02 PM

Answers

  • Multiple contexts won't be a huge problem if the set of entities for each context is distinct and there are no associations across object contexts. So splitting by schema is a logical approach. Another caveat if you want to work with updates under multiple contexts is to use TransactionScope to guarantee atomicity:

    http://msdn.microsoft.com/en-us/library/system.transactions.transactionscope.aspx

     

    -adi


    Adi Unnithan | Software Design Engineer | SQL Server Developer Tools | Please mark the post as answered if it sufficiently answers your question
    • Proposed as answer by Larcolais Gong Wednesday, August 31, 2011 2:02 AM
    • Marked as answer by Larcolais Gong Monday, September 5, 2011 7:39 AM
    Monday, August 29, 2011 6:23 PM

All replies

  • Neither would be a problem but.... they can't be done in same project right?  Reason: Just try to add a new model to a project that already has one.
    JP
    Monday, August 29, 2011 3:29 PM
  • Multiple contexts won't be a huge problem if the set of entities for each context is distinct and there are no associations across object contexts. So splitting by schema is a logical approach. Another caveat if you want to work with updates under multiple contexts is to use TransactionScope to guarantee atomicity:

    http://msdn.microsoft.com/en-us/library/system.transactions.transactionscope.aspx

     

    -adi


    Adi Unnithan | Software Design Engineer | SQL Server Developer Tools | Please mark the post as answered if it sufficiently answers your question
    • Proposed as answer by Larcolais Gong Wednesday, August 31, 2011 2:02 AM
    • Marked as answer by Larcolais Gong Monday, September 5, 2011 7:39 AM
    Monday, August 29, 2011 6:23 PM