diff --git a/docs/en/Tutorials/Part-1.md b/docs/en/Tutorials/Part-1.md index 6795204936..e5a8750f39 100644 --- a/docs/en/Tutorials/Part-1.md +++ b/docs/en/Tutorials/Part-1.md @@ -368,7 +368,7 @@ public class CreateUpdateBookDto { [Required] [StringLength(128)] - public string Name { get; set; } + public string Name { get; set; } = string.Empty; [Required] public BookType Type { get; set; } = BookType.Undefined; diff --git a/docs/en/Tutorials/Part-10.md b/docs/en/Tutorials/Part-10.md index d06cea6b6e..601905f522 100644 --- a/docs/en/Tutorials/Part-10.md +++ b/docs/en/Tutorials/Part-10.md @@ -788,7 +788,7 @@ public class CreateModalModel : BookStorePageModel [Required] [StringLength(128)] - public string Name { get; set; } + public string Name { get; set; } = string.Empty; [Required] public BookType Type { get; set; } = BookType.Undefined; @@ -871,7 +871,7 @@ public class EditModalModel : BookStorePageModel [Required] [StringLength(128)] - public string Name { get; set; } + public string Name { get; set; } = string.Empty; [Required] public BookType Type { get; set; } = BookType.Undefined; diff --git a/docs/en/Tutorials/Part-6.md b/docs/en/Tutorials/Part-6.md index 40b334808c..2cb525b4a4 100644 --- a/docs/en/Tutorials/Part-6.md +++ b/docs/en/Tutorials/Part-6.md @@ -75,9 +75,9 @@ public class Author : FullAuditedAggregateRoot internal Author( Guid id, - [NotNull] string name, + string name, DateTime birthDate, - [CanBeNull] string shortBio = null) + string? shortBio = null) : base(id) { SetName(name); @@ -85,13 +85,13 @@ public class Author : FullAuditedAggregateRoot ShortBio = shortBio; } - internal Author ChangeName([NotNull] string name) + internal Author ChangeName(string name) { SetName(name); return this; } - private void SetName([NotNull] string name) + private void SetName(string name) { Name = Check.NotNullOrWhiteSpace( name, @@ -146,9 +146,9 @@ public class AuthorManager : DomainService } public async Task CreateAsync( - [NotNull] string name, + string name, DateTime birthDate, - [CanBeNull] string shortBio = null) + string? shortBio = null) { Check.NotNullOrWhiteSpace(name, nameof(name)); @@ -167,8 +167,8 @@ public class AuthorManager : DomainService } public async Task ChangeNameAsync( - [NotNull] Author author, - [NotNull] string newName) + Author author, + string newName) { Check.NotNull(author, nameof(author)); Check.NotNullOrWhiteSpace(newName, nameof(newName)); diff --git a/docs/en/Tutorials/Part-8.md b/docs/en/Tutorials/Part-8.md index 7ea3c6cbae..a1563f6b2c 100644 --- a/docs/en/Tutorials/Part-8.md +++ b/docs/en/Tutorials/Part-8.md @@ -123,12 +123,12 @@ public class CreateAuthorDto { [Required] [StringLength(AuthorConsts.MaxNameLength)] - public string Name { get; set; } + public string Name { get; set; } = string.Empty; [Required] public DateTime BirthDate { get; set; } - public string ShortBio { get; set; } + public string? ShortBio { get; set; } } ```` @@ -146,12 +146,12 @@ public class UpdateAuthorDto { [Required] [StringLength(AuthorConsts.MaxNameLength)] - public string Name { get; set; } + public string Name { get; set; } = string.Empty; [Required] public DateTime BirthDate { get; set; } - public string ShortBio { get; set; } + public string? ShortBio { get; set; } } ```` diff --git a/docs/en/Tutorials/Part-9.md b/docs/en/Tutorials/Part-9.md index 704d5f016b..358448c4d2 100644 --- a/docs/en/Tutorials/Part-9.md +++ b/docs/en/Tutorials/Part-9.md @@ -331,14 +331,14 @@ public class CreateModalModel : BookStorePageModel { [Required] [StringLength(AuthorConsts.MaxNameLength)] - public string Name { get; set; } + public string Name { get; set; } = string.Empty; [Required] [DataType(DataType.Date)] public DateTime BirthDate { get; set; } [TextArea] - public string ShortBio { get; set; } + public string? ShortBio { get; set; } } } ``` @@ -454,14 +454,14 @@ public class EditModalModel : BookStorePageModel [Required] [StringLength(AuthorConsts.MaxNameLength)] - public string Name { get; set; } + public string Name { get; set; } = string.Empty; [Required] [DataType(DataType.Date)] public DateTime BirthDate { get; set; } [TextArea] - public string ShortBio { get; set; } + public string? ShortBio { get; set; } } } ```