none
Dinamic Linq RRS feed

  • Question

  • Hi there:

    Is there a way of obtaining a whole entity object out of a dinamic linq query?.

    The way it's done (according to the documentation) is something like:

    db.Customers.Where("Key = 1").Select("New(Name, Address, ...)"); the problem is that I only get a projection, not the entire entity, therefore I won't have the associations, which are very useful.

    Thanks in advance.

    Rafael
    Believe you can do it, and you will!!
    Wednesday, October 21, 2009 10:44 PM

Answers

  • Instead of .Select("New(...)"), do .Select("it")...   ...the 'it' keyword is one of the 'funny' quirks in dynamic linq... :)
    • Marked as answer by RalphDev Friday, October 23, 2009 2:51 AM
    Thursday, October 22, 2009 1:16 AM

All replies

  • I'm not familiar with the Dynamic Linq sample but you could probably do something like:

    db.Customers.Where("Key = 1");

    [)amien
    Wednesday, October 21, 2009 10:54 PM
    Moderator
  • Instead of .Select("New(...)"), do .Select("it")...   ...the 'it' keyword is one of the 'funny' quirks in dynamic linq... :)
    • Marked as answer by RalphDev Friday, October 23, 2009 2:51 AM
    Thursday, October 22, 2009 1:16 AM