dynamic-linq

System.LINQ.Dynamic: Select(“ new (…)”) into a List<T> (or any other enumerable collection of <T>)

本小妞迷上赌 提交于 2019-11-26 15:57:42
Say I have a DataTable with four columns, Company (string), Fund (string), State (string), Value(double): table1.Rows.Add("Company 1","Fund 1","NY",100)); table1.Rows.Add("Company 2","Fund 1","CA",200)); table1.Rows.Add("Company 3","Fund 1","FL",300)); table1.Rows.Add("Company 4","Fund 2","CA",400)); table1.Rows.Add("Company 5","Fund 1","NY",500)); table1.Rows.Add("Company 6","Fund 2","CA",600)); table1.Rows.Add("Company 7","Fund 3","FL",700)); I want to use System.LINQ.Dynamic to build a dynamic query which groups on either Company, Fund, or State, and then selects my group by criteria as the

How do I do a left outer join with Dynamic Linq?

最后都变了- 提交于 2019-11-26 13:10:22
问题 I am trying to mimick the left outer join here but using dynamic linq extension methods. What i have: public static IQueryable SelectMany(this IQueryable source, string selector, string resultsSelector, params object[] values) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); // Parse the lambda LambdaExpression lambda = DynamicExpression.ParseLambda( source.ElementType, null, selector, values); // Fix lambda by

Is Injection Possible through Dynamic LINQ?

ⅰ亾dé卋堺 提交于 2019-11-26 13:09:23
问题 Using the Dynamic LINQ library (link), is it vulnerable to injection? and (if so) how can this be protected against? Some background from Security Considerations (Entity Framework): LINQ to Entities injection attacks: Although query composition is possible in LINQ to Entities, it is performed through the object model API. Unlike Entity SQL queries, LINQ to Entities queries are not composed by using string manipulation or concatenation, and they are not susceptible to traditional SQL injection

Sortable JqGrid using LINQ to MySQL (DbLinq) and Dynamic LINQ - Orderby doesn&#39;t work

☆樱花仙子☆ 提交于 2019-11-26 12:30:40
问题 I\'ve got problem with sorting entries in JqGrid. Orderby seem to not work. I set breakpoint in code and I noticed, that orderby doesn\'t change order of elements. Any idea what could be wrong? I\'m using LINQ to SQL with MySQL (DbLinq project). My action code: public ActionResult All(string sidx, string sord, int page, int rows) { var tickets = ZTRepository.GetAllTickets().OrderBy(sidx + \" \" + sord).ToList(); var rowdata = ( from ticket in tickets select new { i = ticket.ID, cell = new