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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T13:03:22+00:00 2026-06-09T13:03:22+00:00

I have a service with domain model and I want expose data to clients.

  • 0

I have a service with domain model and I want expose data to clients. Service has typical architecture: database, ORM(EF), business layer with domain model.

I want to use WCF DataServices to expose data to clients, but I can’t send data objects from domain model to client. I going to use DTO to interact with clients and I have dto<=>data objects mapping.

DataServices has reflection provider which seems to be fine in this case(let’s consider read-only scenario). But reflection provider require IQueryable<dto> property to be exposed. And this is the problem. So I see following ways to solve it:

  1. Load all domain objects, map all of them to dtos and return result dtos. Really bad approach if there are many domain objects exists.
  2. Create a “linq2dto” provider and generate dynamically correspondent “linq2EF” query, at point of query materialization get data objects from db and perform mapping. Its sounds good, but as I see, it a complicated task.

So guys, I need help. I do not want to write(and support!) new one linq provider. May be there is somewhere some “general linq2anyware” realization which I can use?

From other hand, I really can’t expose data objects to client and use DataServices EF provider. Is there some simple way to implement such mapping?

  • 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-09T13:03:24+00:00Added an answer on June 9, 2026 at 1:03 pm

    Unfortunately if you’re really set on using DTOs, you will need to take on the work of performing the query tree translation to something EF can use. That most likely puts you into Custom Provider territory, which is another issue you would have to deal with.

    For the query tree translation specifically, you might look at something like re-linq or IQ toolkit.

    Can we have a short conversation in the comments on the question about why you need DTOs? I think this question will be more useful to others if they can understand that detail as well.

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

Sidebar

Related Questions

I have my service layer serving as a facade over my domain model layer
I am designing a WCF service using DDD. I have a domain service layer
I have a built an MVC application with a model layer containing entities, data
I have this entity service in my domain model with two datetime type properties
I have a domain service, derived from LinqToEntitiesDomainService<FOOEntities> It has one method, IQueryable<Bar> GetBar().
For background, I have a Data layer and Service layer loosely based on Rob
In a RIA Domain service I have added some utility functions. For instance we
I have a dao jar file that contains all the domain objects and service
I have a service returning an array of type BaseItem. BaseItem has N subtypes.
I have web service which i want to use to upload image to the

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.