-
Notifications
You must be signed in to change notification settings - Fork 392
Closed
Labels
Description
TypeAdapterConfig<PagedList<ExampleEntity>, PagedList<ExampleDto>>.ForType().ConstructUsing(dest => new PagedList<ExampleDto>(new List<ExampleDto>(), 1, 1)); = > its work
TypeAdapterConfig<PagedList<Type>, PagedList<Type>>.ForType().ConstructUsing(dest => new PagedList<Type>(new List<Type>(), 1, 1)); it doesn't work and throw Exception
Exception => System.InvalidOperationException : No default constructor for type 'PagedList`1', please use 'ConstructUsing' or 'MapWith'
pagedlist constructors;
`public PagedList(IEnumerable<T> items, int page, int size)
: this(items.AsQueryable(), page, size)
{
}
public PagedList(IEnumerable<T> items, int page, int size, int itemCount)
{
BindItems(page, size, itemCount);
Items = items;
}
public PagedList(IQueryable<T> items, int page, int size)
{
var itemCount = items.Count();
BindItems(page, size, itemCount);
Items = items.PagedBy(page, size).ToList();
} `