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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T02:20:37+00:00 2026-05-11T02:20:37+00:00

Does anyone know of a definitive list of LINQ to SQL query limitations that

  • 0

Does anyone know of a definitive list of LINQ to SQL query limitations that are not trapped at compile time, along with (where possible) workarounds for the limitations?

The list we have so far is:

  • Calling methods such as .Date on DateTime
    • no workaround found
  • string.IsNullOrEmpty
    • simple, just use == '' instead
  • .Last()
    • we used .OrderByDescending(x => x.WhateverProperty).First()
  • 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. 2026-05-11T02:20:38+00:00Added an answer on May 11, 2026 at 2:20 am

    Basically, that list is huge… it is everything outside of the relatively small set of things that are handled. Unfortunately, the Law Of Leaky Abstractions kicks in, and each provider has different answers…

    LINQ-to-Objects will do anything (pretty much), since it is delegates; LINQ-to-SQL and Entity Framework have different sets of support.

    In general, I’ve had a fair amount of success using the DateTime properties etc – but in reality, you’re going to have to ensure that your query expressions are covered by unit tests, so that if you ever change providers (or the provider gets updated) you know it all still works.

    I guess one view is to think in terms of TSQL; there is no BOTTOM n, but there is a TOP 1 (re the OrderByDescending); In terms of string.IsNullOrEmpty, you could be quite literal: foo.Bar == null || foo.Bar == ''; and with DateTime.Date you can probably do quite a bit with DATEPART / the various components.

    Another option with LINQ-to-SQL is to encapsulate the logic in a UDF – so you could write a UDF that takes a datetime and returns a datetime, and expose that via the dbml onto the data-context. You can then use that in your queries:

    where ctx.Date(foo.SomeDate) == DateTime.Today 

    This approach, however, doesn’t necessarily make good use of indexes.


    Update:

    • The supported method translations etc are here.
    • The supported query operations etc are here.

    For the full gory details, you can look at System.Data.Linq.SqlClient.PostBindDotNetConverter+Visitor in reflector – in particular the Translate... methods; some string functions are handled separately. So not a huge selection – but this is an implementation detail.

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

Sidebar

Ask A Question

Stats

  • Questions 65k
  • Answers 65k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer — is wrong. When you use numeric character references, the… May 11, 2026 at 11:18 am
  • added an answer Use the width and precision specifiers, set to the same… May 11, 2026 at 11:18 am
  • added an answer Python's string format method can take a format spec. >>>… May 11, 2026 at 11:18 am

Related Questions

Does anyone know of a definitive list of LINQ to SQL query limitations that
Does anyone know of a good Command Prompt replacement? I've tried bash/Cygwin, but that
Does anyone know of a FOSS Python lib for generating Identicons ? I've looked,
Does anyone know of a good method for editing PDFs in PHP? Preferably open-source/zero-license
does anyone know of a macro or add-on for VS 2008 which reformats xml-comments?
Does anyone know of a good open source plugin for database querying and exploring
Does anyone know of a similar product to Citrix Server that'll run on the
Does anyone know of a way to declare a date constant that is compatible
Does anyone know of a way to alter a computed column without dropping the
Does anyone know of a good (preferably open source) library for dealing with the

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.