AdvancedWf.Data/Repositories/WorkflowTypesRepository.cs
/// <summary>
/// get collection of WorkflowType sorted based on  DatatableParams Order , OrderDir properties
/// </summary>
/// <param name="viewModel">Datatable filter/paging/sort details</param>
/// <param name="cols">WorkflowType fields used for sorting</param>
/// <param name="lst">collection of WorkflowType </param>
/// <returns>sorted collection of WorkflowType</returns>
get collection of WorkflowType sorted based on  DatatableParams Order , OrderDir properties
get collection of WorkflowType sorted based on DatatableParams Order OrderDir properties
private IQueryable<WorkflowTypesDTO> GetListSorted(DatatableParams viewModel, string[] cols, IQueryable<WorkflowTypesDTO> lst)
        {
            var orderField = cols[int.Parse(viewModel.order)] == "StatusName" ? "Status" : cols[int.Parse(viewModel.order)];
            if (viewModel.orderDir == null || viewModel.orderDir == "asc")
            {
                lst = lst.OrderBy(orderField);
            }
            else if (viewModel.orderDir != null && viewModel.orderDir == "desc")
            {
                lst = lst.OrderByDescending(orderField);
            }
            else
            {
                lst = lst.OrderByDescending(a => a.Id);
            }
            return lst;
        }
private IQueryable < WorkflowTypesDTO > GetListSorted ( DatatableParams viewModel , string [ ] cols , IQueryable < WorkflowTypesDTO > lst ) { var orderField = cols [ int . Parse ( viewModel . order ) ] == " " ? " " : cols [ int . Parse ( viewModel . order ) ] ; if ( viewModel . orderDir == null || viewModel . orderDir == " " ) { lst = lst . OrderBy ( orderField ) ; } else if ( viewModel . orderDir != null && viewModel . orderDir == " " ) { lst = lst . OrderByDescending ( orderField ) ; } else { lst = lst . OrderByDescending ( a => a . Id ) ; } return lst ; }
get collection of WorkflowType sorted based on  DatatableParams Order , OrderDir properties
get collection of WorkflowType sorted based on DatatableParams Order OrderDir properties
sorted collection of WorkflowType
sorted collection of WorkflowType
viewModel
DatatableParams
Datatable filter/paging/sort details
Datatable filter / paging / sort details
cols
string[]
WorkflowType fields used for sorting
WorkflowType fields used for sorting
lst
IQueryable<WorkflowTypesDTO>
collection of WorkflowType
collection of WorkflowType