Enable nullable annotations for Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo

pull/17094/head
liangshiwei 2 years ago
parent 3a13b1a6d6
commit 4ea4fa90ba

@ -6,11 +6,11 @@ public class DropDownDemoDemoModel
{
[Required]
[EmailAddress]
public string EmailAddress { get; set; }
public string EmailAddress { get; set; } = default!;
[Required]
[DataType(DataType.Password)]
public string Password { get; set; }
public string Password { get; set; } = default!;
public bool RememberMe { get; set; }
}

@ -40,7 +40,7 @@ public class DynamicFormsDemoModel
[Required]
[DataType(DataType.Password)]
[Display(Name = "Password")]
public string Password { get; set; }
public string Password { get; set; } = default!;
[Display(Name = "Is Active")]
public bool IsActive { get; set; }
@ -87,34 +87,34 @@ public class DynamicFormsDemoModel
public class OrderExampleModel
{
[DisplayOrder(10005)]
public string Surname { get; set; }
public string? Surname { get; set; }
//Default 10000
public string EmailAddress { get; set; }
public string? EmailAddress { get; set; }
[DisplayOrder(10003)]
public string Name { get; set; }
public string? Name { get; set; }
[DisplayOrder(9999)]
public string City { get; set; }
public string? City { get; set; }
}
public class AttributeExamplesModel
{
[HiddenInput]
public string HiddenInput { get; set; }
public string? HiddenInput { get; set; }
[DisabledInput]
public string DisabledInput { get; set; }
public string? DisabledInput { get; set; }
[ReadOnlyInput]
public string ReadonlyInput { get; set; }
public string? ReadonlyInput { get; set; }
[FormControlSize(AbpFormControlSize.Large)]
public string LargeInput { get; set; }
public string? LargeInput { get; set; }
[FormControlSize(AbpFormControlSize.Small)]
public string SmallInput { get; set; }
public string? SmallInput { get; set; }
}
public DetailedModel MyDetailedModel { get; set; }

@ -26,11 +26,11 @@ public class FormElementsDemoModel
public class InformMeModel
{
[Required]
public string Name { get; set; }
public string Name { get; set; } = default!;
[Required]
[DataType(DataType.Password)]
public string Password { get; set; }
public string Password { get; set; } = default!;
public bool CheckMeOut { get; set; }
}
@ -38,14 +38,14 @@ public class FormElementsDemoModel
public class DetailsModel
{
[Required]
public string EmailAddress { get; set; }
public string EmailAddress { get; set; } = default!;
public string City { get; set; }
public string? City { get; set; }
public List<string> Cities { get; set; }
public List<string>? Cities { get; set; }
[TextArea]
public string Description { get; set; }
public string? Description { get; set; }
}
public class CheckboxModel
@ -58,7 +58,7 @@ public class FormElementsDemoModel
public class CityRadioModel
{
[Display(Name = "City")]
public string CityRadio { get; set; }
public string? CityRadio { get; set; }
}
public class EnumModel

@ -13,7 +13,7 @@ public class PaginatorDemoViewComponent : AbpViewComponent
{
public const string ViewPath = "/Views/Components/Themes/Shared/Demos/PaginatorDemo/Default.cshtml";
public PagerModel PagerModel { get; set; }
public PagerModel PagerModel { get; set; } = default!;
public IViewComponentResult Invoke(PagerModel pagerModel)
{

@ -14,8 +14,8 @@ public class AbpComponentDemoSectionTagHelper : AbpTagHelper
private const string DemoSectionOpeningTag = "<abp-component-demo-section";
private const string DemoSectionClosingTag = "</abp-component-demo-section";
public string ViewPath { get; set; }
public string Title { get; set; }
public string ViewPath { get; set; } = default!;
public string? Title { get; set; }
private readonly IVirtualFileProvider _virtualFileProvider;
private readonly IGuidGenerator _guidGenerator;
@ -101,7 +101,7 @@ public class AbpComponentDemoSectionTagHelper : AbpTagHelper
private string GetRawDemoSource()
{
StringBuilder sourceBuilder = null;
StringBuilder? sourceBuilder = null;
var lines = GetFileContent().SplitToLines();

@ -5,6 +5,8 @@
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<WarningsAsErrors>Nullable</WarningsAsErrors>
<AddRazorSupportForMvc>true</AddRazorSupportForMvc>
<AssemblyName>Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo</AssemblyName>
<PackageId>Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Demo</PackageId>

Loading…
Cancel
Save