EFCoreExtensions can be downloaded from NuGet.
...
...
...
PagedResult<Entity> pagedResult = new PagedResult<Entity>();
using(var dbContext = new DbContext())
{
var pagedParameters = new PagedParamBase
{
Page = 1,
PageSize = 10
}
pagedResult = dbContext.Entity.GetPaged(pagedParameters);
}
List<Entity> listResult = pagedResult.Results;
...
...
...
...
...
...
PagedResult<Entity> pagedResult = new PagedResult<Entity>();
using(var dbContext = new DbContext())
{
var pagedParameters = new PagedParamBase
{
Page = 1,
PageSize = 10,
Ordering = new KeyValuePair<string, Ordering>(nameof(Entity.Id), Ordering.Ascending)
}
pagedResult = dbContext.Entity.GetPaged(pagedParameters);
}
List<Entity> listResult = pagedResult.Results;
...
...
...
...
...
...
PagedResult<Entity> pagedResult = new PagedResult<Entity>();
using(var dbContext = new DbContext())
{
var pagedParameters = new PagedParamBase
{
Page = 1,
PageSize = 10,
Ordering = new KeyValuePair<string, Ordering>(nameof(Entity.Id), Ordering.Descending)
}
pagedResult = dbContext.Entity.GetPaged(pagedParameters);
}
List<Entity> listResult = pagedResult.Results;
...
...
...
...
...
...
PagedResult<Entity> pagedResult = new PagedResult<Entity>();
using(var dbContext = new DbContext())
{
var stringValue = "1";
var pagedParameters = new PagedParamBase
{
Page = 1,
PageSize = 10,
Filters = new List<Filter>
{
new Filter
{
Key = nameof(Entity.Id),
Value = stringValue,
Comparison = ComparisonOperators.Equals,
}
}
}
pagedResult = dbContext.Entity.GetPaged(pagedParameters);
}
List<Entity> listResult = pagedResult.Results;
...
...
...
...
...
...
List<Entity> listResult = new List<Entity>();
var stringValue = "John";
using(var dbContext = new DbContext())
{
listResult = dbContext.Entity.WhereLike(nameof(Entity.FullName), stringValue, LikeOptions.StartWith)
}
...
...
...