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

  • SEARCH
  • Home
  • 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 8232535
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T17:51:55+00:00 2026-06-07T17:51:55+00:00

I’m working on a project which uses an Assembler pattern to assemble LinqToEntity entities

  • 0

I’m working on a project which uses an Assembler pattern to assemble LinqToEntity entities into Data Transfer Objects at a service level, which are then passed down to the client layer for use. The approach has been to translate the entitie objects into simplified, flat objects that provide information specific to the service call.

Eg.

// Original Entity looks something like this
public class PersonEntity
{
   public int Id { get; set; }
   public string FirstName { get; set; }
   public string LastName { get; set; }
   public int MotherId { get; set; }  
   public PersonEntity Mother { get; set; }
   // lots of other properties
}

// Flattened DTO
public class PersonSummaryInfo
{
  public int Id { get; set; }
  public string FullName { get; set; }
  public string MothersFullName { get; set; }
}

In this example, the assembler would create a PersonSummaryInfo, constructing the FullNames part of the process.

I now face an issue with some 3rd party control (Telerik ASP.NET MVC GridControl), where the control is set up to filter (using IQueryable) based on it’s Model’s properties. There idea seems to be that you have a single tier design and pump your database entities directly into the view, which I can’t stand.

Trying to incorporate it into my logic, the GridControl binds to my DTO instead of the Entity which is all good until it tries to sort anything. I pushed all of the IQueryable stuff into my service in a very Generic fasion to make it reponsible for this. Sorting attempts to sort by, say MothersFullName on the DTO (its behaviour is to pass “MothersFullName” as a string to your sorting logic), this gets pushed up to my service which through reflection attempts to sort the Entities, making use of IQueryable lazy loading, but of course when the query is executed, an Exception is thrown as “MothersFullName” is not a property of the original Entity.

Is there a good strategy that handles this sort of implementation? Is it good practice to effectively “disassemble” a DTO back to its ORM entity once its back in the Service layer of an application? Or is it better to pass down richer objects that have more knowledge of what they are (such as how to sort a full name using FirstName and LastName)?

What is key to my requirements is:

  • use fancy Telerik control because they like it
  • lazy load results at the service level (ie. dont bring back 2 million records and just display 10)
  • support filtering, paging etc
  • a sound architectural implementation
  • 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-06-07T17:51:57+00:00Added an answer on June 7, 2026 at 5:51 pm

    Went with this solution.

    Create sql Views containing the Grid specific columns. Then made data transfer objects use properties that exactly match those of the View. Not the cleanest or strongest way to achieve this, but at least it gets my Data references out of my projects that don’t need it.

    Did not use dynamic linq, instead kept my generic approach and used reflection to get column names for matching. Did not go for Telerik’s Open Access just because we already have a whole service layer implemented, but it sounds like a nice solution.

    It’s all still IQueryable, so efficiently it works very very well (just relies on developers to ensure the GridViews match the GridViewModels, property for property).

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

Sidebar

Related Questions

Working on a project which uses factories to construct objects. I keep the pointers
I'm currently working on a project which uses many ajax requests to access data
I started working on a project which uses Net_URL_Mapper from PEAR (php) as the
I am working on a project which uses OsmAnd for the maps. I am
I'm working on a project which uses user authentication. I'm facing a issue with
I have just begun working on a project which uses Mercurial as a version
I'm working on using a project which uses jQuery, and I need to dynamically
I'm working on an ASP.NET MVC project which uses the MarkdownDeep Editor to add
I have a large-ish project that I'm working on which uses git as the
I currently working on a project which uses Spree Cart and which has hence

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.