Browse Source

Update Part-9.md

pull/6241/head
Halil İbrahim Kalkan 6 years ago
parent
commit
de8ef3f0a9
  1. 17
      docs/en/Tutorials/Part-9.md

17
docs/en/Tutorials/Part-9.md

@ -843,15 +843,8 @@ Create a new Razor Component Page, `/Pages/Authors.razor`, in the `Acme.BookStor
````xml ````xml
@page "/authors" @page "/authors"
@using Acme.BookStore.Authors @using Acme.BookStore.Authors
@using Acme.BookStore.Localization @inherits BookStoreComponentBase
@using Microsoft.AspNetCore.Authorization
@using Microsoft.Extensions.Localization
@using Volo.Abp.ObjectMapping
@inject IAuthorAppService AuthorAppService @inject IAuthorAppService AuthorAppService
@inject IStringLocalizer<BookStoreResource> L
@inject IAuthorizationService AuthorizationService
@inject IUiMessageService UiMessageService
@inject IObjectMapper ObjectMapper
<Card> <Card>
<CardHeader> <CardHeader>
<Row> <Row>
@ -1038,7 +1031,7 @@ namespace Acme.BookStore.Blazor.Pages
EditingAuthor = new UpdateAuthorDto(); EditingAuthor = new UpdateAuthorDto();
} }
protected async override Task OnInitializedAsync() protected override async Task OnInitializedAsync()
{ {
await SetPermissionsAsync(); await SetPermissionsAsync();
await GetAuthorsAsync(); await GetAuthorsAsync();
@ -1048,10 +1041,10 @@ namespace Acme.BookStore.Blazor.Pages
{ {
CanCreateAuthor = await AuthorizationService CanCreateAuthor = await AuthorizationService
.IsGrantedAsync(BookStorePermissions.Authors.Create); .IsGrantedAsync(BookStorePermissions.Authors.Create);
CanEditAuthor = await AuthorizationService CanEditAuthor = await AuthorizationService
.IsGrantedAsync(BookStorePermissions.Authors.Edit); .IsGrantedAsync(BookStorePermissions.Authors.Edit);
CanDeleteAuthor = await AuthorizationService CanDeleteAuthor = await AuthorizationService
.IsGrantedAsync(BookStorePermissions.Authors.Delete); .IsGrantedAsync(BookStorePermissions.Authors.Delete);
} }
@ -1105,7 +1098,7 @@ namespace Acme.BookStore.Blazor.Pages
private async Task DeleteAuthorAsync(AuthorDto author) private async Task DeleteAuthorAsync(AuthorDto author)
{ {
var confirmMessage = L["AuthorDeletionConfirmationMessage", author.Name]; var confirmMessage = L["AuthorDeletionConfirmationMessage", author.Name];
if (!await UiMessageService.ConfirmAsync(confirmMessage)) if (!await Message.Confirm(confirmMessage))
{ {
return; return;
} }

Loading…
Cancel
Save