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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T10:00:15+00:00 2026-05-16T10:00:15+00:00

A simple linq to SQL query Might return a product object. Obiously I could

  • 0

A simple linq to SQL query Might return a product object. Obiously I could pass this object to my business layer, then read and update the data, directly against that object.

I’ve seen a bunch of implementations where following the execution of the linq query the resulting object is mapped (via automapper or manually) to a custom business object. So in the case of product where I might have the linq object:

product.ProductId
and
Product.ProductName

and then I would define a custom Product business object like so:

class BusineszProduct
{
    string ProductId;
    string ProductName;
}

and some simple mapping code like:

BusinessProduct myProduct = new BusinessProduct();
myProduct.ProductId = product.ProductId;
myProduct.ProductName = product.ProductName;

and then pass myProduct around my business layer, modify it, read it and so on, then later update the linq object.

In what scenarios would I want to create the custom BusinessProduct class?

  • 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-16T10:00:16+00:00Added an answer on May 16, 2026 at 10:00 am

    IMHO, the general reason is to decouple / disentangle your Business Entities from the Linq2SQL ORM baggage that comes with Linq2SQL Entities

    However, in an extreme scenario, you may have multiple mappings:

    • Linq2SQL entities for the “Data Access” Layer – however these are tightly coupled to the L2S DataContext
    • POCOs / Business Entities would be used for business rule application, validation etc
    • If you are using Web Services or WCF, you might also represent the data as Message Entities e.g. if you need to present the entities in a very specific format when they are serialized across the wire
    • And finally, if you have a MVC / MVP / MVVM UI architecture, you might want entities tailored for your views
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a very simple linq to sql query in C#: int acctNum =
I want to translate following simple sql query into Linq to NHibernate: SELECT NewsId
I have a simple query in LINQ to SQL: var id = 23479824; var
I'm having difficuly mapping a simple T-SQL query such as this select min(price) as
Apologies - am not good at SQL. Perhaps this is a simple query -
i have a simple SQL query, but im struggling to replicate in LINQ select
Below is a simple Linq-to-SQL query to delete an address record associated with a
Iam having a serious problems with Linq. I have simple sql query: select intMiesiac,
I've got this simple linq query in NHibernate 3.2 and SQLite provider: var all
my request: http://hostname/sample/getrecord?appid=1&domain=physics,chemistry&platform=cs,ece How to query in linq to sql like IN statement in

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.