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
parent
commit
f0f7ed32a3
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      docs/en/Tutorials/Part-1.md
  2. 4
      docs/en/Tutorials/Part-10.md
  3. 16
      docs/en/Tutorials/Part-6.md
  4. 8
      docs/en/Tutorials/Part-8.md
  5. 8
      docs/en/Tutorials/Part-9.md

2
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;

4
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;

16
docs/en/Tutorials/Part-6.md

@ -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));

8
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; }
}
````

8
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; }
}
}
```

Loading…
Cancel
Save