none
Newbe - Using Take() in ExpressionSyntax RRS feed

  • Question

  • How would I get the top 50 from this query:

     

    var query = from entity in context.CreateQuery<Customer>("Customers")

    where entity.CustomerGUID.Equals(_StrCustomerGUID)

    select entity;

    Wednesday, July 27, 2011 7:17 PM

Answers

  • var query = (from entity in context.CreateQuery<Customer>("Customers")

    where entity.CustomerGUID.Equals(_StrCustomerGUID)

    select entity).Take(50);

    • Marked as answer by Rob Vig Wednesday, July 27, 2011 7:31 PM
    Wednesday, July 27, 2011 7:31 PM

All replies

  • var query = (from entity in context.CreateQuery<Customer>("Customers")

    where entity.CustomerGUID.Equals(_StrCustomerGUID)

    select entity).Take(50);

    • Marked as answer by Rob Vig Wednesday, July 27, 2011 7:31 PM
    Wednesday, July 27, 2011 7:31 PM
  • Here's an example for a current working project of mine:

            var stuff = from q in ae.t_issue_tracking.Take(recordcount)
                  orderby q.call_end descending
                  select q;   
    

    I pass in the record count so I can get different number of records returned.


    JP
    Wednesday, July 27, 2011 7:32 PM