I am struggling to find LINQ orderby instances where the data is sorted by column index, is it possible is?
Thanks
There is no such concept in column in LINQ, only fields and properties What do you mean is to specify an indicator of an anonymous type of property created by you:
Select 1 from the order of p from the persons new {p.FirstNam, p. LastName} This is not possible because A) You can not place an order through a projection property (anonymity type output value), and b) To order by letter index can not be a work around), you "sign" can use keywords:
from P by individuals to order. First name select {first = p.FirstName, last = p.LastName} in tmp, Orderby tmp. First select tmp; If you use the LINQ provider based on IQueryable (from LINQ to SQL, as opposed to the LINQ object which is based on IEnumerable), you parse the expression tree. You can add expression based on some index, and related call order method.
var query = newest person name {name = p.FirstName + "" + p.ListName, ...} query = AddOrderByPosition (query, 1); Foreach (var p) in the query {...} AddOrderByPosition will create a new expression tree which is the source of the original query expression (a sub-query, which is essentially "in" Also creates) and finally add a call to the order (no need to select). For the first time you want to read the C # Chashma chapters about the change of query expressions, and if you have to do this in a wise amount of time then you should have some experience with reflection and expression.
If you wish, I have some sample code that I can provide.
Comments
Post a Comment