/// <summary> /// Get DataSource Result /// </summary> /// <typeparam name="TModel"></typeparam> /// <typeparam name="TData"></typeparam> /// <param name="request"></param> /// <param name="query"></param> /// <param name="mapper"></param> /// <returns></returns> public static DataSourceResult GetDataSourceResult <TModel, TData>(this DataSourceRequest request, IQueryable <TData> query, IMapper mapper, ICollection <Expression <Func <IQueryable <TModel>, IIncludableQueryable <TModel, object> > > > includeProperties = null) where TModel : BaseModel where TData : BaseData => request.Groups != null && request.Groups.Count > 0 ? request.GetGroupedDataSourceResult <TModel, TData>(query, mapper, request.Aggregates != null && request.Aggregates.Count > 0, includeProperties) : request.GetUngroupedDataSourceResult <TModel, TData>(query, mapper, request.Aggregates != null && request.Aggregates.Count > 0, includeProperties);
/// <summary> /// Get DataSource Result /// </summary> /// <typeparam name="TModel"></typeparam> /// <typeparam name="TData"></typeparam> /// <param name="request"></param> /// <param name="contextRepository"></param> /// <param name="selectExpandDefinition"></param> /// <param name="includeProperties"></param> /// <returns></returns> public static async Task <DataSourceResult> GetDataSourceResult <TModel, TData>(this DataSourceRequest request, IContextRepository contextRepository, SelectExpandDefinition selectExpandDefinition = null, ICollection <Expression <Func <IQueryable <TModel>, IIncludableQueryable <TModel, object> > > > includeProperties = null) where TModel : BaseModel where TData : BaseData => request.Groups != null && request.Groups.Count > 0 ? await request.GetGroupedDataSourceResult <TModel, TData>(contextRepository, request.Aggregates != null && request.Aggregates.Count > 0, selectExpandDefinition, includeProperties) : await request.GetUngroupedDataSourceResult <TModel, TData>(contextRepository, request.Aggregates != null && request.Aggregates.Count > 0, selectExpandDefinition);