What is POCO in Entity Framework?

.net c# entity-framework poco

Question

I've only recently begun learning POCO, but I'm having trouble grasping its benefits. Even clicking the stackoverflow link didn't help.

What is POCO's Entity Framework?

Can somebody give a straightforward example of how to use POCO?

1
80
5/23/2017 12:02:45 PM

Accepted Answer

POCOs (Plain Old CLR Objects) are merely domain entities. Typically, when using entity framework, the entities are created for you automatically. Unfortunately, database access capability is intermingled with these entities, which is plainly against the SOC (Separation of concern). POCOs are straightforward entities that lack data access functionality but nevertheless provide all EntityObject features, such as

  • sluggish loading
  • change monitoring

This is a fantastic place to start.

Entity framework for POCO

Using code generators, you can also create POCOs from an existing Entity Framework project.

DbContext code generator for EF 5.X

99
1/27/2017 2:54:27 PM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow