c# - Retrieve two values in the same linq query -


I am starting with linqToSql and I still have some questions in making my queries.

For example, I want to get an integer with two values, a subset of elements, and count of elements in the same query. In this way I have done it separately:

  integer elements; IEnumerable & LT; ClsTax & gt; result; Outcome = (Select new ClsTax {tax = T.TX1, increase = TNRCTs} from T. db.tax Take (25); Total Elements = (Select the new ClsTax {tax = t.tax1, increase = t.increase} from db.tax). Calculation ();  

As you can see, I can not use results.count () because I only used Tech (25) to get the first 25 elements, and I It is to know how many elements are

thanks

post text "itemprop = "Text">

How about:

  var all = (Choose from db.tax to select new claxex in te {tax = ttx1, increase = increase t}); Var calculation = all.Count (); Var results = all.Take (25);  

A little easier?


Comments

Popular posts from this blog

MySql variables and php -

url rewriting - How to implement the returnurl like SO in PHP? -

Which Python client library should I use for CouchdB? -