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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T01:02:10+00:00 2026-06-07T01:02:10+00:00

i want to be able to do such a projection: var result = from

  • 0

i want to be able to do such a projection:

var result = from record in MyTable
             select MapTo( record );

             /*
             select new RecordModel( )
             {
                 RecordId = record.Id,
                 Property1 = record.Property1
             };
             */

private RecordModel MapTo( MyTable dbRecord )
{
    return new RecordModel( )
    {
        RecordId = dbRecord.Id,
        Property1 = dbRecord.Property1
    };
}

but i always get a ‘NotSupportedException’ (has no supported translation to sql).
I’m not sure if this is even possible but it would be nice^^

Maybe this is possible when i use an expression but i don’t know how to code such an expression.

  • 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-07T01:02:11+00:00Added an answer on June 7, 2026 at 1:02 am

    Linq tries to add the method to the query and sees it cannot be translated to Sql.

    To be able to execute any CLR method in the Linq query, you need to execute the sql part of it first, so that you operate on in-memory objects. Like this:

    var result = from record in MyTable.ToList()
                 select MapTo(record);
    

    Anything that forces MyTable to enumerate its entries should work.

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

Sidebar

Related Questions

I want to be able to get Sinatra views from sub-directories of ./views (such
I want to be able to transfer basic information (strings and such) from an
I want to be able to call certain methods and such that are contained
I want to be able to append divs to my page such that they
So I want to be able to recognise patterns in images (such as a
I want to be able to save a link such as example.com/get.php?id=4 I want
Using Python 2.6 I want to be able to convert numbers such as 00000,
I want to be able to configure the Azure Load Balancer Emulator in such
I want to be able to generate help documentation from existing topic files (.AML)
I want to be able to convert a string number such as 1,427.76 to

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.