Browse Source
Merge pull request #18585 from abpframework/liangshiwei/docs
Enhance Totorials document for nullable reference
pull/18586/head
Engincan VESKE
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with
19 additions and
19 deletions
-
docs/en/Tutorials/Part-1.md
-
docs/en/Tutorials/Part-10.md
-
docs/en/Tutorials/Part-6.md
-
docs/en/Tutorials/Part-8.md
-
docs/en/Tutorials/Part-9.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; |
|
|
|
|
|
|
|
@ -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; |
|
|
|
|
|
|
|
@ -75,9 +75,9 @@ public class Author : FullAuditedAggregateRoot<Guid> |
|
|
|
|
|
|
|
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<Guid> |
|
|
|
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<Author> 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)); |
|
|
|
|
|
|
|
@ -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; } |
|
|
|
} |
|
|
|
```` |
|
|
|
|
|
|
|
|
|
|
|
@ -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; } |
|
|
|
} |
|
|
|
} |
|
|
|
``` |
|
|
|
|