Using WCF with EF RRS feed

  • Question

  • User-545631939 posted


    I am using EF 4 for data access and WCF for communication. Would it be better to separate out the EF part into a separate project and then interface it to WCF, or would it be ok if I make direct calls to EF within my service contract implementation itself?

    Seeking wisdom from my Gurus!

    Novice kid

    Monday, September 17, 2012 10:24 AM


All replies

  • User-837620913 posted

    It depends on what adding an additional layer would "buy" you in development terms. If you are not reusing that from another UI or other layer, and the code is relatively simple, then keeping it in the same layer may be ok.

    On the other hand, having tested WCF services myself, maybe splitting them into two different projects (with almost all code in the non-WCF project) would make writing unit tests much easier. 

    There is a trend I've noticed among some developers in the community that are going back to simplifying the project layout. Jimmy Bogard has been the most notable one: http://lostechies.com/jimmybogard/2009/12/09/organizing-asp-net-mvc-solutions/ and http://lostechies.com/jimmybogard/2012/08/30/evolutionary-project-structure/

    At the other extreme some people have 10 projects (which may be too extreme): http://efmvc.codeplex.com/

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, September 18, 2012 5:35 AM
  • User-545631939 posted

    Many thanks, Guru Darrell!

    Tuesday, September 18, 2012 8:54 AM
  • User3866881 posted

    Many thanks, Guru Darrell!


    I come here just wanna check whether this issue is solved or not……Please mark answers or kind feedback.


    Tuesday, September 18, 2012 9:29 PM