Skip to content

mustaddon/LinqString

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Releases

No releases published

Packages

No packages published