Entity framework in a layered architecture?

Error processing SSI file


  1. Hysi

    • 2015/2/16

    I've done some digging on this, and here are my findings on this.

    ADO.NET Data Services:

    You can use ADO.NET Data services (you need SP1) to expose your Entity framework over the wire, with almost zero code. But as I understand, the only limitation is, the transaction is over HTTP. That means, there is a small over head in terms of serialization (we all know binary serialization is faster), but the advantage is the speed of implementation for our services.

    I got an unofficial word from John [http://twitter.com/John_Papa] on this - "Definitely more options with wcf. More work in most cases too. Astoria exposes entities easily. Perf diffs are negligible in most cases"

    The advantages - You don't really need to write any services at all - You can just hook the validation and security logic around the data services and entity framework and we are done. Ideal if you are consuming data centric services over http - in scenarios like having a silverlight client, or a winform/wpf front end over http.

    Exposing Entity Framework over WCF:

    With SP1, there is lot of support for employing entity framework in layered architectures. This includes support for eager loading and context management. Of course, in this case, we need to write the services (and the logic behind our methods). Or if we have the entity framework model totally alligned with the db, we could generate most of the services, which includes the methods we need.

    Recommending you to read this http://msdn.microsoft.com/en-us/magazine/cc700340.aspx

    Another alternative might be to use EFPocoAdapter, to have a plain POCO wrapper on top of the entity framework for dtos, instead of exposing entity framework classes directly. Right now it is a compass project for next version of Entity framework http://code.msdn.microsoft.com/EFPocoAdapter.

  2. Eli

    • 2019/10/7

    Under the Core layer, check Entity classes that provide all tables for e-commerce domain. This folder include model classes which we use all 

  3. Dubois

    • 2017/5/15

    I will present a sample architecture that contains layers for a logical store database, data access, a domain model, a business manager, a service layer, a presentation layer, and a passive UI layer, and I will demonstrate how these layers integrate using the Entity Framework.

  4. Arturo

    • 2021/2/8

    Repository implementations of Infrastructure layer has Entity Framework Core context, wrapper class and Repositories which perform db operations 

  5. Durand

    • 2017/10/3

    It's a very bad idea to expose EF classes over WCF. Microsoft made some serious mistakes that prevent this from being a useful scenario. They've exposed the entities as data contrracts, but also the base classes of the entity, and for backward links, expose two copies of the link.

    On the other hand, it appears that ADO.NET Data Services have some magic that allow something close to this to work. Read the SilverLight article in this month's MSDN Magazine for an example, from the client side, of using ADO.NET Data Services.

  6. Vihaan

    • 2021/4/27

    9. I am using a layered architecture with the Entity Framework. Here's What I came up with till now (All the projects Except UI are class library): Entities: The POCO Entities. Completely persistence ignorant. No Reference to other projects. Generated by Microsoft's ADO.Net POCO Entity Generator. DAL: The EDMX (Entity Model) file with the

  7. Lopez

    • 2016/12/6

    Architecture of Business Layer working with Entity Framework · 1. The Business Layer defines the data structures · 2. The Business Layer should 

  8. Pagano

    • 2018/12/2

    Entity client provides the ability for developers to work against entities in the form of rows and columns using entity SQL queries without the need to generate classes to represent conceptual schema. Entity Client shows the entity framework layers, which are the core functionality. These layers are called as Entity Data Model.

  9. Jason

    • 2015/12/19

    Not to bring up an old post but... I found this listing when dealing with the exact same problem. We have WCF services and an Entity Framwork domain model. In the end I ended up making a T4 based on work by Danny Simmons that takes the EDMX and builds POCO message classes along with extension methods that map entity.ToMessage() and message.ToEntity(objectcontext).

    This seemed like the best intermediate approach until .NET 4.0 since it requires no additional external project dependencies or hoops to jump through like the other methods I found (based on PostSharp).

    If anyone else thinks this approach would be helpful let me know and I will post the link to the TT file on our googlecode site.

  10. Jayden

    • 2020/5/16

    Entity Framework in layered architecture · Entities: The POCO Entities. Completely persistence ignorant. · DAL: The EDMX (Entity Model) file with 

  11. Hassan

    • 2016/7/8

    Layered Architecture in Entity Framework 4.0. Ask Question Asked 10 years, 10 months ago. Active 10 days ago. Viewed 1k times 3 4. Hi I am trying architect a small

  12. Nicolas

    • 2019/9/3

    Business Objects/Entity layer. ThreeLayerSample.Domain class project in this example. 1. Connect to the database with Entity Framework Core.

  13. Winston

    • 2021/6/12

    Lets see which folders included in this Core Layer; Data. Includes Entity Framework Core Context and tables in this folder. When new entity created, it should add to context and configure in

  14. Corbin

    • 2017/9/14

    In this month's column I will demonstrate how the Entity Framework can fit into an n-tier architecture that uses Windows® Communication 

  15. Hamza

    • 2021/7/2

    NET Microservices Architecture for Containerized .NET Applications | Explore the implementation details for the infrastructure persistence 

  16. Alex

    • 2020/2/2

    I am using a layered architecture with the Entity Framework. Here's What I came up with till now (All the projects Except UI are class library):.

  17. Poli

    • 2018/9/9

    Entity Client · The Storage Layer contains the entire database schema in XML format. · The Entity Layer which is also an XML file defines the entities and 

  18. Harold

    • 2016/8/29

    Layered architecture using Entity Framework with different class libraries · Both UI and DAL are dependent on the BLL · BLL is not dependent on 

Comments are closed.

More Posts