Skip to content

Latest commit

 

History

History
27 lines (21 loc) · 683 Bytes

README.md

File metadata and controls

27 lines (21 loc) · 683 Bytes

LinqString NuGet version

IQueryable.Select by property names (EF compatible extensions)

using LinqString;


var result = queryableSource
    .OrderBy("SubObj.Prop1", ">Prop2")
    .Select("Prop1", "Prop2", "SubObj.Prop1")
    .ToList();

// is an analogue of

var analogue = queryableSource
    .OrderBy(x => x.SubObj.Prop1)
    .ThenByDescending(x => x.Prop2)
    .Select(x => new { 
        x.Prop1,
        x.Prop2,
        SubObj = new { 
            x.SubObj.Prop1
        },
    }).ToList();

Program.cs