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 5971487
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T20:31:23+00:00 2026-05-22T20:31:23+00:00

A question regarding the repository pattern and query object pattern. I’m using EF 4

  • 0

A question regarding the repository pattern and query object pattern. I’m using EF 4 and have generated my POCO classes from my database model using the ADO.NET POCO Entity Generator in VS 2010. The edmx file and the tt file (POCO classes) are in 2 different projects.

My repositories are domain specific, e.g DocumentRepository and UserRepository. My database model differs from my domain model in such a degree that I have implemented mappers in order to translate a domain object to one or more database tables (and vice versa). One example is that my Document domain class is modeled as 3 tables (and therefore POCO classes) in the database.

How would you implement the query object pattern when using domain objects in such a case? The way I see it I’ll have to write the query object base on the POCO classes and not the domain classes? But wouldn’t that break the repository pattern?

  • 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-22T20:31:23+00:00Added an answer on May 22, 2026 at 8:31 pm

    ORM is usually used in the way that it works directly with domain objects = it loads them from database and it persist them to database. You are doing one more abstraction step where you are using ORM entities only to fill your custom objects. Your custom objects are completely out of scope of your ORM tool and you cannot expect that ORM tool will provide you any support for queries build on top of your domain objects. You must built your own query support and translate domain queries to ORM queries inside your repositories. This is usually done by implementing Specification pattern.

    Btw. in such scenario POCOs doesn’t make too much sense – POCOs are for scenarios where you want to use them as domain objects).

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

Sidebar

Related Questions

A question regarding a DB development project. The database already exist and is rather
I have a question regarding the two additional columns (timeCreated, timeLastUpdated) for each record
I have a question regarding an update function I created... CREATE OR REPLACE FUNCTION
I have a question regarding handling errors in a J2EE application. Our current application
Question regarding how to setup dbase relationships (newbie, this may be trivial) Followed the
Quick question regarding CSS and the browser. I tried searching SO and found some
Following my question regarding a .NET YAML Library ... as there doesn't seem to
This is a question regarding Unix shell scripting (any shell), but any other "standard"
I previously asked a question regarding MX records (and appreciate the thoughtful answers I
This is a very specific question regarding MySQL as implemented in WordPress . I'm

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.