Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 874733
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T11:09:07+00:00 2026-05-15T11:09:07+00:00

We have an ASP.Net MVC2 web site, and are utilizing EF4 for database access,

  • 0

We have an ASP.Net MVC2 web site, and are utilizing EF4 for database access, etc. Being new to EF4, we have come across the EF4 POCO concept, however do not fully understand it.

In general, I’ve heard POCO defined as objects “not dependent on an external framework”. In the case of EF4, I’m guessing this means that POCO would imply somehow creating lighter-weight entities? If this is the case, what EF4 plumbing does POCO not have, what are the pros/cons of this, what extra development work might one need with POCO. In summary, when is it good to use POCO in EF4?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T11:09:08+00:00Added an answer on May 15, 2026 at 11:09 am

    “POCO” is a vague term in the ORM space. People variously use it to mean:

    • “Pure” POCOs, which do no change tracking, lazy loading, have private properties, etc. They can be challenging to work with.
    • Psuedo-POCO proxies: The types with everything public virtual and which have different types at runtime.
    • Self-tracking entities. Not POCOs, but not EntityObject either.

    I find the “not dependent on an external framework” definition to be somewhat self-serving. It’s a way of ignoring the limitations of a framework. I.e., proxies are not real POCOs in my book, but they meet that definition.

    What’s wrong with EntityObject? Not a lot. It’s fairly lightweight, and it’s part of .NET. It’s in the .NET 4 client profile, even. It doesn’t even chain you to the EF. Although it would be sort of odd to use it as a “POCO type” with a different framework, it would work just fine. It’s not in Silverlight, though, IIRC.

    POCO entities are harder to work with, because you lose the stuff that EntityObject gives you for free. That’s not a lot, but something to consider before chosing POCOs just because “they’re cool,” especially for those new to the EF.

    One thing that a lot of people who get religious about POCOs tend to ignore: Mapping non-POCO types in no way limits you to exposing those non-POCO types externally. Your data services can project mapped non-POCO types onto unmapped POCO DTOs and you can choose to only expose those types, i.e.:

    public IEnumerable<FooDto> IFooRepository.SelectAll()
    {
        return from f in Context.Foos
               select new FooDto { Id = f.Id, Name = f.Name };
    }
    

    So mapping types and data service types can easily be different concerns, if you so choose.

    When doe you absolutely need non-EntityObject types for mapping? Well, if you need self-tracking entities, then that’s an open and shut case. If you must expose your mapped types to Silverlight, clearly then as well.

    Beyond that it’s less clear. If you’re writing a data service for public consumption, then you should not make the DTOs be EntityObject subtypes, because that would stand in the way of plugging in a different framework later on. I would never make an immutable, public interface dependent on any one framework, even one included in .NET. On the other hand, as I said above, you can expose one type and map another; there’s no requirement to expose mapped types, ever, and often very good reasons to not expose them (perhaps they contain non-public data).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an asp.net site. Its a mixture of web forms and MVC2. I
I have an ASP.NET MVC 2 web site in which I'd like to place
I have an ASP .net MVC 2.0 web site and I am using the
I have a ASP.Net MVC 2 web site, which can be visited by http://localhost/Admin/ContentMgr/
I have an ASP:NET MVC 2 web site that is on SSL. I want
In my ASP.Net web sites I have the following code that I am able
While working on ASP.NET MVC 2 web site I faced to the following problem.
I need to create Unit Tests for an ASP.NET MVC 2.0 web site. The
If i have an ASP.NET MVC 2 Web Application with the following Views: Main.aspx
I have developed an ASP.NET MVC 2 website, and now need to deploy it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.