Browse Source

Enable nullable annotations for Volo.Abp.Ddd.Domain.Shared

pull/17303/head
liangshiwei 3 years ago
parent
commit
671c6156a0
  1. 2
      framework/src/Volo.Abp.Ddd.Domain.Shared/Volo.Abp.Ddd.Domain.Shared.csproj
  2. 6
      framework/src/Volo.Abp.Ddd.Domain.Shared/Volo/Abp/Domain/Entities/Events/Distributed/EntityEto.cs
  3. 2
      framework/src/Volo.Abp.Ddd.Domain.Shared/Volo/Abp/Domain/Entities/Events/Distributed/EtoMappingDictionary.cs
  4. 4
      framework/src/Volo.Abp.Ddd.Domain.Shared/Volo/Abp/Domain/Entities/Events/Distributed/EtoMappingDictionaryItem.cs

2
framework/src/Volo.Abp.Ddd.Domain.Shared/Volo.Abp.Ddd.Domain.Shared.csproj

@ -5,6 +5,8 @@
<PropertyGroup>
<TargetFrameworks>netstandard2.0;netstandard2.1;net7.0</TargetFrameworks>
<Nullable>enable</Nullable>
<WarningsAsErrors>Nullable</WarningsAsErrors>
<AssemblyName>Volo.Abp.Ddd.Domain.Shared</AssemblyName>
<PackageId>Volo.Abp.Ddd.Domain.Shared</PackageId>
<AssetTargetFallback>$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;</AssetTargetFallback>

6
framework/src/Volo.Abp.Ddd.Domain.Shared/Volo/Abp/Domain/Entities/Events/Distributed/EntityEto.cs

@ -5,9 +5,9 @@ namespace Volo.Abp.Domain.Entities.Events.Distributed;
[Serializable]
public class EntityEto : EtoBase
{
public string EntityType { get; set; }
public string EntityType { get; set; } = default!;
public string KeysAsString { get; set; }
public string KeysAsString { get; set; } = default!;
public EntityEto()
{
@ -23,5 +23,5 @@ public class EntityEto : EtoBase
public abstract class EntityEto<TKey> : IEntityEto<TKey>
{
public TKey Id { get; set; }
public TKey Id { get; set; } = default!;
}

2
framework/src/Volo.Abp.Ddd.Domain.Shared/Volo/Abp/Domain/Entities/Events/Distributed/EtoMappingDictionary.cs

@ -5,7 +5,7 @@ namespace Volo.Abp.Domain.Entities.Events.Distributed;
public class EtoMappingDictionary : Dictionary<Type, EtoMappingDictionaryItem>
{
public void Add<TEntity, TEntityEto>(Type objectMappingContextType = null)
public void Add<TEntity, TEntityEto>(Type? objectMappingContextType = null)
{
this[typeof(TEntity)] = new EtoMappingDictionaryItem(typeof(TEntityEto), objectMappingContextType);
}

4
framework/src/Volo.Abp.Ddd.Domain.Shared/Volo/Abp/Domain/Entities/Events/Distributed/EtoMappingDictionaryItem.cs

@ -6,9 +6,9 @@ public class EtoMappingDictionaryItem
{
public Type EtoType { get; }
public Type ObjectMappingContextType { get; }
public Type? ObjectMappingContextType { get; }
public EtoMappingDictionaryItem(Type etoType, Type objectMappingContextType = null)
public EtoMappingDictionaryItem(Type etoType, Type? objectMappingContextType = null)
{
EtoType = etoType;
ObjectMappingContextType = objectMappingContextType;

Loading…
Cancel
Save