Browse Source

remove not necessary nullable check from blazor validation

pull/7598/head
Ahmet 6 years ago
parent
commit
6fd1a0267c
  1. 8
      docs/en/Tutorials/Part-9.md

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

@ -1121,7 +1121,7 @@ namespace Acme.BookStore.Blazor.Pages
private void OpenCreateAuthorModal() private void OpenCreateAuthorModal()
{ {
CreateValidationsRef?.ClearAll(); CreateValidationsRef.ClearAll();
NewAuthor = new CreateAuthorDto(); NewAuthor = new CreateAuthorDto();
CreateAuthorModal.Show(); CreateAuthorModal.Show();
@ -1134,7 +1134,7 @@ namespace Acme.BookStore.Blazor.Pages
private void OpenEditAuthorModal(AuthorDto author) private void OpenEditAuthorModal(AuthorDto author)
{ {
EditValidationsRef?.ClearAll(); EditValidationsRef.ClearAll();
EditingAuthorId = author.Id; EditingAuthorId = author.Id;
EditingAuthor = ObjectMapper.Map<AuthorDto, UpdateAuthorDto>(author); EditingAuthor = ObjectMapper.Map<AuthorDto, UpdateAuthorDto>(author);
@ -1160,7 +1160,7 @@ namespace Acme.BookStore.Blazor.Pages
private async Task CreateAuthorAsync() private async Task CreateAuthorAsync()
{ {
if (CreateValidationsRef?.ValidateAll() ?? true) if (CreateValidationsRef.ValidateAll())
{ {
await AuthorAppService.CreateAsync(NewAuthor); await AuthorAppService.CreateAsync(NewAuthor);
await GetAuthorsAsync(); await GetAuthorsAsync();
@ -1170,7 +1170,7 @@ namespace Acme.BookStore.Blazor.Pages
private async Task UpdateAuthorAsync() private async Task UpdateAuthorAsync()
{ {
if (EditValidationsRef?.ValidateAll() ?? true) if (EditValidationsRef.ValidateAll())
{ {
await AuthorAppService.UpdateAsync(EditingAuthorId, EditingAuthor); await AuthorAppService.UpdateAsync(EditingAuthorId, EditingAuthor);
await GetAuthorsAsync(); await GetAuthorsAsync();

Loading…
Cancel
Save