Merge branch 'rel-4.0' into dev

pull/6601/head
Halil İbrahim Kalkan 4 years ago
commit 6d76158c88

@ -604,6 +604,7 @@ Open the `Books.razor` and replace the content as the following:
<DataGrid TItem="BookDto"
Data="Entities"
ReadData="OnDataGridReadAsync"
CurrentPage="CurrentPage"
TotalItems="TotalCount"
ShowPager="true"
PageSize="PageSize">

@ -1429,6 +1429,7 @@ Here the complete code to create the book management CRUD page, that has been de
<DataGrid TItem="BookDto"
Data="Entities"
ReadData="OnDataGridReadAsync"
CurrentPage="CurrentPage"
TotalItems="TotalCount"
ShowPager="true"
PageSize="PageSize">

@ -868,6 +868,7 @@ Create a new Razor Component Page, `/Pages/Authors.razor`, in the `Acme.BookStor
<DataGrid TItem="AuthorDto"
Data="AuthorList"
ReadData="OnDataGridReadAsync"
CurrentPage="CurrentPage"
TotalItems="TotalCount"
ShowPager="true"
PageSize="PageSize">

@ -175,7 +175,7 @@ namespace Volo.Abp.BlazoriseUI
protected virtual int PageSize { get; } = LimitedResultRequestDto.DefaultMaxResultCount;
protected int CurrentPage;
protected int CurrentPage = 1;
protected string CurrentSorting;
protected int? TotalCount;
protected TGetListInput GetListInput = new TGetListInput();
@ -255,7 +255,7 @@ namespace Volo.Abp.BlazoriseUI
if (GetListInput is IPagedResultRequest pagedResultRequestInput)
{
pagedResultRequestInput.SkipCount = CurrentPage * PageSize;
pagedResultRequestInput.SkipCount = (CurrentPage - 1) * PageSize;
}
if (GetListInput is ILimitedResultRequest limitedResultRequestInput)
@ -266,13 +266,22 @@ namespace Volo.Abp.BlazoriseUI
return Task.CompletedTask;
}
protected virtual async Task SearchEntitiesAsync()
{
CurrentPage = 1;
await GetEntitiesAsync();
StateHasChanged();
}
protected virtual async Task OnDataGridReadAsync(DataGridReadDataEventArgs<TListViewModel> e)
{
CurrentSorting = e.Columns
.Where(c => c.Direction != SortDirection.None)
.Select(c => c.Field + (c.Direction == SortDirection.Descending ? " DESC" : ""))
.JoinAsString(",");
CurrentPage = e.Page - 1;
CurrentPage = e.Page;
await GetEntitiesAsync();

@ -30,7 +30,7 @@ namespace Volo.Abp.Domain.Repositories.EntityFrameworkCore
private readonly IDbContextProvider<TDbContext> _dbContextProvider;
private readonly Lazy<AbpEntityOptions<TEntity>> _entityOptionsLazy;
protected virtual IGuidGenerator GuidGenerator { get; set; }
public virtual IGuidGenerator GuidGenerator { get; set; }
public EfCoreRepository(IDbContextProvider<TDbContext> dbContextProvider)
{

Loading…
Cancel
Save