Browse Source

Merge pull request #22958 from abpframework/liangshiwei/docs-patch

Update Blazor server web tutorials document
pull/22959/head
maliming 1 year ago
committed by GitHub
parent
commit
65a9e733e7
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 49
      docs/en/tutorials/book-store/part-09.md

49
docs/en/tutorials/book-store/part-09.md

@ -1158,14 +1158,21 @@ public partial class Authors
private async Task DeleteAuthorAsync(AuthorDto author)
{
var confirmMessage = L["AuthorDeletionConfirmationMessage", author.Name];
if (!await Message.Confirm(confirmMessage))
try
{
return;
}
var confirmMessage = L["AuthorDeletionConfirmationMessage", author.Name];
if (!await Message.Confirm(confirmMessage))
{
return;
}
await AuthorAppService.DeleteAsync(author.Id);
await GetAuthorsAsync();
await AuthorAppService.DeleteAsync(author.Id);
await GetAuthorsAsync();
}
catch(Exception ex)
{
await HandleErrorAsync(ex);
}
}
private void CloseEditAuthorModal()
@ -1175,21 +1182,35 @@ public partial class Authors
private async Task CreateAuthorAsync()
{
if (await CreateValidationsRef.ValidateAll())
try
{
await AuthorAppService.CreateAsync(NewAuthor);
await GetAuthorsAsync();
CreateAuthorModal.Hide();
if (await CreateValidationsRef.ValidateAll())
{
await AuthorAppService.CreateAsync(NewAuthor);
await GetAuthorsAsync();
CreateAuthorModal.Hide();
}
}
catch(Exception ex)
{
await HandleErrorAsync(ex);
}
}
private async Task UpdateAuthorAsync()
{
if (await EditValidationsRef.ValidateAll())
try
{
await AuthorAppService.UpdateAsync(EditingAuthorId, EditingAuthor);
await GetAuthorsAsync();
EditAuthorModal.Hide();
if (await EditValidationsRef.ValidateAll())
{
await AuthorAppService.UpdateAsync(EditingAuthorId, EditingAuthor);
await GetAuthorsAsync();
EditAuthorModal.Hide();
}
}
catch(Exception ex)
{
await HandleErrorAsync(ex);
}
}
}

Loading…
Cancel
Save