none
EF connected and disconnected architecture sample RRS feed

  • Question

  • i am looking for two sample code which tell me which code is following connected architecture and which one follow disconnected architecture.

    please share the two right sample code. thanks

    Wednesday, November 1, 2017 8:41 AM

Answers

  • i am looking for two sample code which tell me which code is following connected architecture and which one follow disconnected architecture.

    please share the two right sample code. thanks

    If EF is being using in a N-Tier solution, then EF is being used in a disconnected state. You should be able to find examples or tutorials that use EF in N-Tier.

    If EF is being used in ASP.NET MVC solution where the controller  is doing DB activities directly through the controller, then that is EF being used in a connected state, which is bad new and is not the intent of the MVC UI design pattern. And you can for sure find plenty of examples using Bing or Google 

     
    • Marked as answer by Sudip_inn Monday, November 13, 2017 11:59 AM
    Wednesday, November 1, 2017 1:11 PM
  • Hi Sudip_inn,

    In the case of a connected scenario the changes are tracked by the context but in the case of a disconnected scenario we need to inform the context about the state of the entity.

    And the following article provide two simple sample for your reference.

    www.c-sharpcorner.com/UploadFile/d87001/connected-and-disconnected-scenario-in-entity-framework/

    Best regards,

    Cole Wu


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by Sudip_inn Monday, November 13, 2017 11:59 AM
    Monday, November 13, 2017 6:17 AM
    Moderator

All replies

  • i am looking for two sample code which tell me which code is following connected architecture and which one follow disconnected architecture.

    please share the two right sample code. thanks

    If EF is being using in a N-Tier solution, then EF is being used in a disconnected state. You should be able to find examples or tutorials that use EF in N-Tier.

    If EF is being used in ASP.NET MVC solution where the controller  is doing DB activities directly through the controller, then that is EF being used in a connected state, which is bad new and is not the intent of the MVC UI design pattern. And you can for sure find plenty of examples using Bing or Google 

     
    • Marked as answer by Sudip_inn Monday, November 13, 2017 11:59 AM
    Wednesday, November 1, 2017 1:11 PM
  • Hi Sudip_inn,

    In the case of a connected scenario the changes are tracked by the context but in the case of a disconnected scenario we need to inform the context about the state of the entity.

    And the following article provide two simple sample for your reference.

    www.c-sharpcorner.com/UploadFile/d87001/connected-and-disconnected-scenario-in-entity-framework/

    Best regards,

    Cole Wu


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by Sudip_inn Monday, November 13, 2017 11:59 AM
    Monday, November 13, 2017 6:17 AM
    Moderator