Skip to content
secretorangePublic

About

Easy sorting of IQueryables. Helps to keep your code clean when sorting on multiple columns.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

Easy Sort

A simple way to sort LINQ IQueryables when, for example, you have multiple columns in a table and you'd like to provide support for asc/desc sorting on a number of them.

Example usage

private static EasySort<Project> Easy = new EasySort<Project>()
                                        .Map("site",      e => e.Site.Name)
                                        .Map("name",      e => e.Name)
                                        .Map("category",  e => e.Category.Name)
                                        .Map("creator",   e => e.Creator.FirstName)
                                        .Map("modified",  e => e.DateModified);


public IList<Project> List(int categoryId, string sortKey, Order sortOrder)
{
  var query = Context.Project.Where(e => e.CategoryId == categoryId);
  
  return Easy.Sort(query, sortKey, sortOrder).ToList();
}

About

Easy sorting of IQueryables. Helps to keep your code clean when sorting on multiple columns.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages