From dd762f3496993902e7842b0dff795a0ce01c587f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Onur=20P=C4=B1=C3=A7akc=C4=B1?= Date: Thu, 26 Jan 2023 10:11:21 +0300 Subject: [PATCH] Update Part-10.md --- docs/en/Tutorials/Part-10.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/en/Tutorials/Part-10.md b/docs/en/Tutorials/Part-10.md index 9f1f274d17..6178ebbb8e 100644 --- a/docs/en/Tutorials/Part-10.md +++ b/docs/en/Tutorials/Part-10.md @@ -1130,15 +1130,15 @@ Override the `OpenCreateModalAsync` method and adding the following code: ````csharp protected override async Task OpenCreateModalAsync() +{ + if (!authorList.Any()) { - if (!authorList.Any()) - { - throw new UserFriendlyException(message: L["AnAuthorIsRequiredForCreatingBook"]); - } - - await base.OpenCreateModalAsync(); - NewEntity.AuthorId = authorList.First().Id; + throw new UserFriendlyException(message: L["AnAuthorIsRequiredForCreatingBook"]); } + + await base.OpenCreateModalAsync(); + NewEntity.AuthorId = authorList.First().Id; +} ```` The final `@code` block should be the following: