Browse Source

Merge pull request #17303 from abpframework/liangshiwei/group11

Group11 Enable nullable annotations
pull/17331/head
maliming 3 years ago
committed by GitHub
parent
commit
7e03f4b48a
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      framework/src/Volo.Abp.Auditing.Contracts/Volo/Abp/Auditing/IDeletionAuditedObject.cs
  2. 3
      framework/src/Volo.Abp.Auditing.Contracts/Volo/Abp/Auditing/IMayHaveCreator.cs
  3. 2
      framework/src/Volo.Abp.Auditing.Contracts/Volo/Abp/Auditing/IModificationAuditedObject.cs
  4. 2
      framework/src/Volo.Abp.BlazoriseUI/Components/ObjectExtending/LookupExtensionProperty.razor
  5. 2
      framework/src/Volo.Abp.Dapper/Volo.Abp.Dapper.csproj
  6. 6
      framework/src/Volo.Abp.Dapper/Volo/Abp/Domain/Repositories/Dapper/DapperRepository.cs
  7. 4
      framework/src/Volo.Abp.Dapper/Volo/Abp/Domain/Repositories/Dapper/IDapperRepository.cs
  8. 2
      framework/src/Volo.Abp.Dapr/Volo.Abp.Dapr.csproj
  9. 8
      framework/src/Volo.Abp.Dapr/Volo/Abp/Dapr/AbpDaprClientFactory.cs
  10. 8
      framework/src/Volo.Abp.Dapr/Volo/Abp/Dapr/AbpDaprModule.cs
  11. 8
      framework/src/Volo.Abp.Dapr/Volo/Abp/Dapr/AbpDaprOptions.cs
  12. 4
      framework/src/Volo.Abp.Dapr/Volo/Abp/Dapr/DaprApiTokenProvider.cs
  13. 8
      framework/src/Volo.Abp.Dapr/Volo/Abp/Dapr/IAbpDaprClientFactory.cs
  14. 4
      framework/src/Volo.Abp.Dapr/Volo/Abp/Dapr/IDaprApiTokenProvider.cs
  15. 2
      framework/src/Volo.Abp.Ddd.Application.Contracts/Volo.Abp.Ddd.Application.Contracts.csproj
  16. 8
      framework/src/Volo.Abp.Ddd.Application.Contracts/Volo/Abp/Application/Dtos/AuditedEntityWithUserDto.cs
  17. 4
      framework/src/Volo.Abp.Ddd.Application.Contracts/Volo/Abp/Application/Dtos/CreationAuditedEntityWithUserDto.cs
  18. 2
      framework/src/Volo.Abp.Ddd.Application.Contracts/Volo/Abp/Application/Dtos/EntityDto.cs
  19. 8
      framework/src/Volo.Abp.Ddd.Application.Contracts/Volo/Abp/Application/Dtos/ExtensibleAuditedEntityWithUserDto.cs
  20. 4
      framework/src/Volo.Abp.Ddd.Application.Contracts/Volo/Abp/Application/Dtos/ExtensibleCreationAuditedEntityWithUserDto.cs
  21. 2
      framework/src/Volo.Abp.Ddd.Application.Contracts/Volo/Abp/Application/Dtos/ExtensibleEntityDto.cs
  22. 12
      framework/src/Volo.Abp.Ddd.Application.Contracts/Volo/Abp/Application/Dtos/ExtensibleFullAuditedEntityWithUserDto.cs
  23. 12
      framework/src/Volo.Abp.Ddd.Application.Contracts/Volo/Abp/Application/Dtos/FullAuditedEntityWithUserDto.cs
  24. 2
      framework/src/Volo.Abp.Ddd.Application.Contracts/Volo/Abp/Application/Dtos/ISortedResultRequest.cs
  25. 4
      framework/src/Volo.Abp.Ddd.Application.Contracts/Volo/Abp/Application/Dtos/LimitedResultRequestDto.cs
  26. 4
      framework/src/Volo.Abp.Ddd.Application.Contracts/Volo/Abp/Application/Dtos/ListResultDto.cs
  27. 4
      framework/src/Volo.Abp.Ddd.Application.Contracts/Volo/Abp/Application/Dtos/PagedAndSortedResultRequestDto.cs
  28. 2
      framework/src/Volo.Abp.Ddd.Application/Volo.Abp.Ddd.Application.csproj
  29. 6
      framework/src/Volo.Abp.Ddd.Application/Volo/Abp/Application/Services/AbstractKeyCrudAppService.cs
  30. 6
      framework/src/Volo.Abp.Ddd.Application/Volo/Abp/Application/Services/AbstractKeyReadOnlyAppService.cs
  31. 20
      framework/src/Volo.Abp.Ddd.Application/Volo/Abp/Application/Services/ApplicationService.cs
  32. 2
      framework/src/Volo.Abp.Ddd.Domain.Shared/Volo.Abp.Ddd.Domain.Shared.csproj
  33. 6
      framework/src/Volo.Abp.Ddd.Domain.Shared/Volo/Abp/Domain/Entities/Events/Distributed/EntityEto.cs
  34. 2
      framework/src/Volo.Abp.Ddd.Domain.Shared/Volo/Abp/Domain/Entities/Events/Distributed/EtoMappingDictionary.cs
  35. 4
      framework/src/Volo.Abp.Ddd.Domain.Shared/Volo/Abp/Domain/Entities/Events/Distributed/EtoMappingDictionaryItem.cs
  36. 3
      framework/src/Volo.Abp.Ddd.Domain.Shared/Volo/Abp/Domain/Entities/Events/Distributed/IEntityToEtoMapper.cs
  37. 2
      framework/src/Volo.Abp.Ddd.Domain/Volo.Abp.Ddd.Domain.csproj
  38. 10
      framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/DependencyInjection/AbpCommonDbContextRegistrationOptions.cs
  39. 2
      framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/DependencyInjection/IAbpCommonDbContextRegistrationOptionsBuilder.cs
  40. 2
      framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/DependencyInjection/MultiTenantDbContextType.cs
  41. 8
      framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Auditing/AuditedAggregateRootWithUser.cs
  42. 8
      framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Auditing/AuditedEntityWithUser.cs
  43. 4
      framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Auditing/CreationAuditedAggregateRootWithUser.cs
  44. 4
      framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Auditing/CreationAuditedEntityWithUser.cs
  45. 12
      framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Auditing/FullAuditedAggregateRootWithUser.cs
  46. 12
      framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Auditing/FullAuditedEntityWithUser.cs
  47. 12
      framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Caching/EntityCacheBase.cs
  48. 6
      framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Caching/EntityCacheServiceCollectionExtensions.cs
  49. 2
      framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Caching/EntityCacheWithObjectMapper.cs
  50. 2
      framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Caching/EntityCacheWithoutCacheItem.cs
  51. 3
      framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Caching/IEntityCache.cs
  52. 8
      framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Entity.cs
  53. 16
      framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/EntityHelper.cs
  54. 7
      framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Events/Distributed/EntitySynchronizer.cs
  55. 4
      framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Events/Distributed/EntityToEtoMapper.cs
  56. 2
      framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Events/EntityChangeEventHelper.cs
  57. 2
      framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Events/EntityEventData.cs
  58. 2
      framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/IEntity.cs
  59. 6
      framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Repositories/BasicRepositoryBase.cs
  60. 2
      framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Repositories/IReadOnlyBasicRepository.cs
  61. 2
      framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Repositories/IRepository.cs
  62. 12
      framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Repositories/RepositoryAsyncExtensions.cs
  63. 8
      framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Repositories/RepositoryBase.cs
  64. 8
      framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Repositories/RepositoryExtensions.cs
  65. 4
      framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Repositories/RepositoryRegistrarBase.cs
  66. 6
      framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Services/DomainService.cs
  67. 2
      framework/src/Volo.Abp.DistributedLocking.Abstractions/Volo.Abp.DistributedLocking.Abstractions.csproj
  68. 3
      framework/src/Volo.Abp.DistributedLocking.Abstractions/Volo/Abp/DistributedLocking/IAbpDistributedLock.cs
  69. 2
      framework/src/Volo.Abp.DistributedLocking.Abstractions/Volo/Abp/DistributedLocking/LocalAbpDistributedLock.cs
  70. 2
      framework/src/Volo.Abp.DistributedLocking.Dapr/Volo.Abp.DistributedLocking.Dapr.csproj
  71. 2
      framework/src/Volo.Abp.DistributedLocking.Dapr/Volo/Abp/DistributedLocking/Dapr/AbpDistributedLockDaprOptions.cs
  72. 2
      framework/src/Volo.Abp.DistributedLocking.Dapr/Volo/Abp/DistributedLocking/Dapr/DaprAbpDistributedLock.cs
  73. 2
      framework/src/Volo.Abp.DistributedLocking/Volo.Abp.DistributedLocking.csproj
  74. 2
      framework/src/Volo.Abp.DistributedLocking/Volo/Abp/DistributedLocking/MedallionAbpDistributedLock.cs
  75. 8
      framework/src/Volo.Abp.Threading/Volo/Abp/Linq/AsyncQueryableExecuter.cs
  76. 8
      framework/src/Volo.Abp.Threading/Volo/Abp/Linq/IAsyncQueryableExecuter.cs
  77. 8
      framework/src/Volo.Abp.Threading/Volo/Abp/Linq/IAsyncQueryableProvider.cs

2
framework/src/Volo.Abp.Auditing.Contracts/Volo/Abp/Auditing/IDeletionAuditedObject.cs

@ -22,5 +22,5 @@ public interface IDeletionAuditedObject<TUser> : IDeletionAuditedObject
/// <summary>
/// Reference to the deleter user.
/// </summary>
TUser Deleter { get; }
TUser? Deleter { get; }
}

3
framework/src/Volo.Abp.Auditing.Contracts/Volo/Abp/Auditing/IMayHaveCreator.cs

@ -8,8 +8,7 @@ public interface IMayHaveCreator<TCreator>
/// <summary>
/// Reference to the creator.
/// </summary>
[CanBeNull]
TCreator Creator { get; }
TCreator? Creator { get; }
}
/// <summary>

2
framework/src/Volo.Abp.Auditing.Contracts/Volo/Abp/Auditing/IModificationAuditedObject.cs

@ -22,5 +22,5 @@ public interface IModificationAuditedObject<TUser> : IModificationAuditedObject
/// <summary>
/// Reference to the last modifier user of this entity.
/// </summary>
TUser LastModifier { get; }
TUser? LastModifier { get; }
}

2
framework/src/Volo.Abp.BlazoriseUI/Components/ObjectExtending/LookupExtensionProperty.razor

@ -9,7 +9,7 @@
<Autocomplete Data="@lookupItems"
TItem="SelectItem<object>"
TValue="object"
TextField="item => item?.Text"
TextField="item => item?.Text!"
ValueField="item => item?.Value"
SelectedValue="@SelectedValue"
SelectedValueChanged="@SelectedValueChanged"

2
framework/src/Volo.Abp.Dapper/Volo.Abp.Dapper.csproj

@ -5,6 +5,8 @@
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<WarningsAsErrors>Nullable</WarningsAsErrors>
<AssemblyName>Volo.Abp.Dapper</AssemblyName>
<PackageId>Volo.Abp.Dapper</PackageId>
<AssetTargetFallback>$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;</AssetTargetFallback>

6
framework/src/Volo.Abp.Dapper/Volo/Abp/Domain/Repositories/Dapper/DapperRepository.cs

@ -16,7 +16,7 @@ namespace Volo.Abp.Domain.Repositories.Dapper;
public class DapperRepository<TDbContext> : IDapperRepository, IUnitOfWorkEnabled
where TDbContext : IEfCoreDbContext
{
public IAbpLazyServiceProvider LazyServiceProvider { get; set; }
public IAbpLazyServiceProvider LazyServiceProvider { get; set; } = default!;
public IDataFilter DataFilter => LazyServiceProvider.LazyGetRequiredService<IDataFilter>();
@ -39,9 +39,9 @@ public class DapperRepository<TDbContext> : IDapperRepository, IUnitOfWorkEnable
public virtual async Task<IDbConnection> GetDbConnectionAsync() => (await _dbContextProvider.GetDbContextAsync()).Database.GetDbConnection();
[Obsolete("Use GetDbTransactionAsync method.")]
public IDbTransaction DbTransaction => _dbContextProvider.GetDbContext().Database.CurrentTransaction?.GetDbTransaction();
public IDbTransaction? DbTransaction => _dbContextProvider.GetDbContext().Database.CurrentTransaction?.GetDbTransaction();
public virtual async Task<IDbTransaction> GetDbTransactionAsync() => (await _dbContextProvider.GetDbContextAsync()).Database.CurrentTransaction?.GetDbTransaction();
public virtual async Task<IDbTransaction?> GetDbTransactionAsync() => (await _dbContextProvider.GetDbContextAsync()).Database.CurrentTransaction?.GetDbTransaction();
protected virtual CancellationToken GetCancellationToken(CancellationToken preferredValue = default)
{

4
framework/src/Volo.Abp.Dapper/Volo/Abp/Domain/Repositories/Dapper/IDapperRepository.cs

@ -12,7 +12,7 @@ public interface IDapperRepository
Task<IDbConnection> GetDbConnectionAsync();
[Obsolete("Use GetDbTransactionAsync method.")]
IDbTransaction DbTransaction { get; }
IDbTransaction? DbTransaction { get; }
Task<IDbTransaction> GetDbTransactionAsync();
Task<IDbTransaction?> GetDbTransactionAsync();
}

2
framework/src/Volo.Abp.Dapr/Volo.Abp.Dapr.csproj

@ -5,6 +5,8 @@
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<WarningsAsErrors>Nullable</WarningsAsErrors>
<RootNamespace />
</PropertyGroup>

8
framework/src/Volo.Abp.Dapr/Volo/Abp/Dapr/AbpDaprClientFactory.cs

@ -24,7 +24,7 @@ public class AbpDaprClientFactory : IAbpDaprClientFactory, ISingletonDependency
JsonSerializerOptions = CreateJsonSerializerOptions(systemTextJsonSerializerOptions.Value);
}
public virtual DaprClient Create(Action<DaprClientBuilder> builderAction = null)
public virtual DaprClient Create(Action<DaprClientBuilder>? builderAction = null)
{
var builder = new DaprClientBuilder()
.UseJsonSerializationOptions(JsonSerializerOptions);
@ -51,9 +51,9 @@ public class AbpDaprClientFactory : IAbpDaprClientFactory, ISingletonDependency
}
public virtual HttpClient CreateHttpClient(
string appId = null,
string daprEndpoint = null,
string daprApiToken = null)
string? appId = null,
string? daprEndpoint = null,
string? daprApiToken = null)
{
if(daprEndpoint.IsNullOrWhiteSpace() &&
!DaprOptions.HttpEndpoint.IsNullOrWhiteSpace())

8
framework/src/Volo.Abp.Dapr/Volo/Abp/Dapr/AbpDaprModule.cs

@ -33,14 +33,14 @@ public class AbpDaprModule : AbpModule
var confEnv = configuration["DAPR_API_TOKEN"];
if (!confEnv.IsNullOrWhiteSpace())
{
options.DaprApiToken = confEnv;
options.DaprApiToken = confEnv!;
}
else
{
var env = Environment.GetEnvironmentVariable("DAPR_API_TOKEN");
if (!env.IsNullOrWhiteSpace())
{
options.DaprApiToken = env;
options.DaprApiToken = env!;
}
}
}
@ -50,14 +50,14 @@ public class AbpDaprModule : AbpModule
var confEnv = configuration["APP_API_TOKEN"];
if (!confEnv.IsNullOrWhiteSpace())
{
options.AppApiToken = confEnv;
options.AppApiToken = confEnv!;
}
else
{
var env = Environment.GetEnvironmentVariable("APP_API_TOKEN");
if (!env.IsNullOrWhiteSpace())
{
options.AppApiToken = env;
options.AppApiToken = env!;
}
}
}

8
framework/src/Volo.Abp.Dapr/Volo/Abp/Dapr/AbpDaprOptions.cs

@ -2,11 +2,11 @@
public class AbpDaprOptions
{
public string HttpEndpoint { get; set; }
public string? HttpEndpoint { get; set; }
public string GrpcEndpoint { get; set; }
public string? GrpcEndpoint { get; set; }
public string DaprApiToken { get; set; }
public string? DaprApiToken { get; set; }
public string AppApiToken { get; set; }
public string? AppApiToken { get; set; }
}

4
framework/src/Volo.Abp.Dapr/Volo/Abp/Dapr/DaprApiTokenProvider.cs

@ -12,12 +12,12 @@ public class DaprApiTokenProvider : IDaprApiTokenProvider, ISingletonDependency
Options = options.Value;
}
public virtual string GetDaprApiToken()
public virtual string? GetDaprApiToken()
{
return Options.DaprApiToken;
}
public virtual string GetAppApiToken()
public virtual string? GetAppApiToken()
{
return Options.AppApiToken;
}

8
framework/src/Volo.Abp.Dapr/Volo/Abp/Dapr/IAbpDaprClientFactory.cs

@ -6,11 +6,11 @@ namespace Volo.Abp.Dapr;
public interface IAbpDaprClientFactory
{
DaprClient Create(Action<DaprClientBuilder> builderAction = null);
DaprClient Create(Action<DaprClientBuilder>? builderAction = null);
HttpClient CreateHttpClient(
string appId = null,
string daprEndpoint = null,
string daprApiToken = null
string? appId = null,
string? daprEndpoint = null,
string? daprApiToken = null
);
}

4
framework/src/Volo.Abp.Dapr/Volo/Abp/Dapr/IDaprApiTokenProvider.cs

@ -2,7 +2,7 @@ namespace Volo.Abp.Dapr;
public interface IDaprApiTokenProvider
{
string GetDaprApiToken();
string? GetDaprApiToken();
string GetAppApiToken();
string? GetAppApiToken();
}

2
framework/src/Volo.Abp.Ddd.Application.Contracts/Volo.Abp.Ddd.Application.Contracts.csproj

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

8
framework/src/Volo.Abp.Ddd.Application.Contracts/Volo/Abp/Application/Dtos/AuditedEntityWithUserDto.cs

@ -12,10 +12,10 @@ namespace Volo.Abp.Application.Dtos;
public abstract class AuditedEntityWithUserDto<TUserDto> : AuditedEntityDto, IAuditedObject<TUserDto>
{
/// <inheritdoc />
public TUserDto Creator { get; set; }
public TUserDto? Creator { get; set; }
/// <inheritdoc />
public TUserDto LastModifier { get; set; }
public TUserDto? LastModifier { get; set; }
}
/// <summary>
@ -28,8 +28,8 @@ public abstract class AuditedEntityWithUserDto<TUserDto> : AuditedEntityDto, IAu
public abstract class AuditedEntityWithUserDto<TPrimaryKey, TUserDto> : AuditedEntityDto<TPrimaryKey>, IAuditedObject<TUserDto>
{
/// <inheritdoc />
public TUserDto Creator { get; set; }
public TUserDto? Creator { get; set; }
/// <inheritdoc />
public TUserDto LastModifier { get; set; }
public TUserDto? LastModifier { get; set; }
}

4
framework/src/Volo.Abp.Ddd.Application.Contracts/Volo/Abp/Application/Dtos/CreationAuditedEntityWithUserDto.cs

@ -11,7 +11,7 @@ namespace Volo.Abp.Application.Dtos;
[Serializable]
public abstract class CreationAuditedEntityWithUserDto<TUserDto> : CreationAuditedEntityDto, ICreationAuditedObject<TUserDto>
{
public TUserDto Creator { get; set; }
public TUserDto? Creator { get; set; }
}
/// <summary>
@ -23,5 +23,5 @@ public abstract class CreationAuditedEntityWithUserDto<TUserDto> : CreationAudit
[Serializable]
public abstract class CreationAuditedEntityWithUserDto<TPrimaryKey, TUserDto> : CreationAuditedEntityDto<TPrimaryKey>, ICreationAuditedObject<TUserDto>
{
public TUserDto Creator { get; set; }
public TUserDto? Creator { get; set; }
}

2
framework/src/Volo.Abp.Ddd.Application.Contracts/Volo/Abp/Application/Dtos/EntityDto.cs

@ -17,7 +17,7 @@ public abstract class EntityDto<TKey> : EntityDto, IEntityDto<TKey>
/// <summary>
/// Id of the entity.
/// </summary>
public TKey Id { get; set; }
public TKey Id { get; set; } = default!;
public override string ToString()
{

8
framework/src/Volo.Abp.Ddd.Application.Contracts/Volo/Abp/Application/Dtos/ExtensibleAuditedEntityWithUserDto.cs

@ -15,10 +15,10 @@ namespace Volo.Abp.Application.Dtos;
public abstract class ExtensibleAuditedEntityWithUserDto<TPrimaryKey, TUserDto> : ExtensibleAuditedEntityDto<TPrimaryKey>, IAuditedObject<TUserDto>
{
/// <inheritdoc />
public TUserDto Creator { get; set; }
public TUserDto? Creator { get; set; }
/// <inheritdoc />
public TUserDto LastModifier { get; set; }
public TUserDto? LastModifier { get; set; }
protected ExtensibleAuditedEntityWithUserDto()
: this(true)
@ -44,10 +44,10 @@ public abstract class ExtensibleAuditedEntityWithUserDto<TUserDto> : ExtensibleA
IAuditedObject<TUserDto>
{
/// <inheritdoc />
public TUserDto Creator { get; set; }
public TUserDto? Creator { get; set; }
/// <inheritdoc />
public TUserDto LastModifier { get; set; }
public TUserDto? LastModifier { get; set; }
protected ExtensibleAuditedEntityWithUserDto()
: this(true)

4
framework/src/Volo.Abp.Ddd.Application.Contracts/Volo/Abp/Application/Dtos/ExtensibleCreationAuditedEntityWithUserDto.cs

@ -14,7 +14,7 @@ namespace Volo.Abp.Application.Dtos;
[Serializable]
public abstract class ExtensibleCreationAuditedEntityWithUserDto<TPrimaryKey, TUserDto> : ExtensibleCreationAuditedEntityDto<TPrimaryKey>, ICreationAuditedObject<TUserDto>
{
public TUserDto Creator { get; set; }
public TUserDto? Creator { get; set; }
protected ExtensibleCreationAuditedEntityWithUserDto()
: this(true)
@ -39,7 +39,7 @@ public abstract class ExtensibleCreationAuditedEntityWithUserDto<TPrimaryKey, TU
public abstract class ExtensibleCreationAuditedEntityWithUserDto<TUserDto> : ExtensibleCreationAuditedEntityDto,
ICreationAuditedObject<TUserDto>
{
public TUserDto Creator { get; set; }
public TUserDto? Creator { get; set; }
protected ExtensibleCreationAuditedEntityWithUserDto()
: this(true)

2
framework/src/Volo.Abp.Ddd.Application.Contracts/Volo/Abp/Application/Dtos/ExtensibleEntityDto.cs

@ -9,7 +9,7 @@ public abstract class ExtensibleEntityDto<TKey> : ExtensibleObject, IEntityDto<T
/// <summary>
/// Id of the entity.
/// </summary>
public TKey Id { get; set; }
public TKey Id { get; set; } = default!;
protected ExtensibleEntityDto()
: this(true)

12
framework/src/Volo.Abp.Ddd.Application.Contracts/Volo/Abp/Application/Dtos/ExtensibleFullAuditedEntityWithUserDto.cs

@ -15,13 +15,13 @@ namespace Volo.Abp.Application.Dtos;
public abstract class ExtensibleFullAuditedEntityWithUserDto<TPrimaryKey, TUserDto> : ExtensibleFullAuditedEntityDto<TPrimaryKey>, IFullAuditedObject<TUserDto>
{
/// <inheritdoc />
public TUserDto Creator { get; set; }
public TUserDto? Creator { get; set; }
/// <inheritdoc />
public TUserDto LastModifier { get; set; }
public TUserDto? LastModifier { get; set; }
/// <inheritdoc />
public TUserDto Deleter { get; set; }
public TUserDto? Deleter { get; set; }
protected ExtensibleFullAuditedEntityWithUserDto()
: this(true)
@ -47,13 +47,13 @@ public abstract class ExtensibleFullAuditedEntityWithUserDto<TUserDto> : Extensi
IFullAuditedObject<TUserDto>
{
/// <inheritdoc />
public TUserDto Creator { get; set; }
public TUserDto? Creator { get; set; }
/// <inheritdoc />
public TUserDto LastModifier { get; set; }
public TUserDto? LastModifier { get; set; }
/// <inheritdoc />
public TUserDto Deleter { get; set; }
public TUserDto? Deleter { get; set; }
protected ExtensibleFullAuditedEntityWithUserDto()
: this(true)

12
framework/src/Volo.Abp.Ddd.Application.Contracts/Volo/Abp/Application/Dtos/FullAuditedEntityWithUserDto.cs

@ -12,13 +12,13 @@ namespace Volo.Abp.Application.Dtos;
public abstract class FullAuditedEntityWithUserDto<TUserDto> : FullAuditedEntityDto, IFullAuditedObject<TUserDto>
{
/// <inheritdoc />
public TUserDto Creator { get; set; }
public TUserDto? Creator { get; set; }
/// <inheritdoc />
public TUserDto LastModifier { get; set; }
public TUserDto? LastModifier { get; set; }
/// <inheritdoc />
public TUserDto Deleter { get; set; }
public TUserDto? Deleter { get; set; }
}
/// <summary>
@ -31,11 +31,11 @@ public abstract class FullAuditedEntityWithUserDto<TUserDto> : FullAuditedEntity
public abstract class FullAuditedEntityWithUserDto<TPrimaryKey, TUserDto> : FullAuditedEntityDto<TPrimaryKey>, IFullAuditedObject<TUserDto>
{
/// <inheritdoc />
public TUserDto Creator { get; set; }
public TUserDto? Creator { get; set; }
/// <inheritdoc />
public TUserDto LastModifier { get; set; }
public TUserDto? LastModifier { get; set; }
/// <inheritdoc />
public TUserDto Deleter { get; set; }
public TUserDto? Deleter { get; set; }
}

2
framework/src/Volo.Abp.Ddd.Application.Contracts/Volo/Abp/Application/Dtos/ISortedResultRequest.cs

@ -16,5 +16,5 @@ public interface ISortedResultRequest
/// "Name DESC"
/// "Name ASC, Age DESC"
/// </example>
string Sorting { get; set; }
string? Sorting { get; set; }
}

4
framework/src/Volo.Abp.Ddd.Application.Contracts/Volo/Abp/Application/Dtos/LimitedResultRequestDto.cs

@ -42,7 +42,7 @@ public class LimitedResultRequestDto : ILimitedResultRequest, IValidatableObject
"MaxResultCountExceededExceptionMessage",
nameof(MaxResultCount),
MaxMaxResultCount,
typeof(LimitedResultRequestDto).FullName,
typeof(LimitedResultRequestDto).FullName!,
nameof(MaxMaxResultCount)
],
new[] { nameof(MaxResultCount) });
@ -90,7 +90,7 @@ public class ExtensibleLimitedResultRequestDto : ExtensibleEntityDto, ILimitedRe
"MaxResultCountExceededExceptionMessage",
nameof(MaxResultCount),
MaxMaxResultCount,
typeof(ExtensibleLimitedResultRequestDto).FullName,
typeof(ExtensibleLimitedResultRequestDto).FullName!,
nameof(MaxMaxResultCount)
],
new[] { nameof(MaxResultCount) });

4
framework/src/Volo.Abp.Ddd.Application.Contracts/Volo/Abp/Application/Dtos/ListResultDto.cs

@ -13,7 +13,7 @@ public class ListResultDto<T> : IListResult<T>
get { return _items ?? (_items = new List<T>()); }
set { _items = value; }
}
private IReadOnlyList<T> _items;
private IReadOnlyList<T>? _items;
/// <summary>
/// Creates a new <see cref="ListResultDto{T}"/> object.
@ -42,7 +42,7 @@ public class ExtensibleListResultDto<T> : ExtensibleObject, IListResult<T>
get { return _items ?? (_items = new List<T>()); }
set { _items = value; }
}
private IReadOnlyList<T> _items;
private IReadOnlyList<T>? _items;
/// <summary>
/// Creates a new <see cref="ListResultDto{T}"/> object.

4
framework/src/Volo.Abp.Ddd.Application.Contracts/Volo/Abp/Application/Dtos/PagedAndSortedResultRequestDto.cs

@ -8,7 +8,7 @@ namespace Volo.Abp.Application.Dtos;
[Serializable]
public class PagedAndSortedResultRequestDto : PagedResultRequestDto, IPagedAndSortedResultRequest
{
public virtual string Sorting { get; set; }
public virtual string? Sorting { get; set; }
}
/// <summary>
@ -17,5 +17,5 @@ public class PagedAndSortedResultRequestDto : PagedResultRequestDto, IPagedAndSo
[Serializable]
public class ExtensiblePagedAndSortedResultRequestDto : ExtensiblePagedResultRequestDto, IPagedAndSortedResultRequest
{
public virtual string Sorting { get; set; }
public virtual string? Sorting { get; set; }
}

2
framework/src/Volo.Abp.Ddd.Application/Volo.Abp.Ddd.Application.csproj

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

6
framework/src/Volo.Abp.Ddd.Application/Volo/Abp/Application/Services/AbstractKeyCrudAppService.cs

@ -70,11 +70,11 @@ public abstract class AbstractKeyCrudAppService<TEntity, TGetOutputDto, TGetList
{
protected IRepository<TEntity> Repository { get; }
protected virtual string CreatePolicyName { get; set; }
protected virtual string? CreatePolicyName { get; set; }
protected virtual string UpdatePolicyName { get; set; }
protected virtual string? UpdatePolicyName { get; set; }
protected virtual string DeletePolicyName { get; set; }
protected virtual string? DeletePolicyName { get; set; }
protected AbstractKeyCrudAppService(IRepository<TEntity> repository)
: base(repository)

6
framework/src/Volo.Abp.Ddd.Application/Volo/Abp/Application/Services/AbstractKeyReadOnlyAppService.cs

@ -40,9 +40,9 @@ public abstract class AbstractKeyReadOnlyAppService<TEntity, TGetOutputDto, TGet
{
protected IReadOnlyRepository<TEntity> ReadOnlyRepository { get; }
protected virtual string GetPolicyName { get; set; }
protected virtual string? GetPolicyName { get; set; }
protected virtual string GetListPolicyName { get; set; }
protected virtual string? GetListPolicyName { get; set; }
protected AbstractKeyReadOnlyAppService(IReadOnlyRepository<TEntity> repository)
{
@ -107,7 +107,7 @@ public abstract class AbstractKeyReadOnlyAppService<TEntity, TGetOutputDto, TGet
{
if (!sortInput.Sorting.IsNullOrWhiteSpace())
{
return query.OrderBy(sortInput.Sorting);
return query.OrderBy(sortInput.Sorting!);
}
}

20
framework/src/Volo.Abp.Ddd.Application/Volo/Abp/Application/Services/ApplicationService.cs

@ -36,10 +36,10 @@ public abstract class ApplicationService :
IGlobalFeatureCheckingEnabled,
ITransientDependency
{
public IAbpLazyServiceProvider LazyServiceProvider { get; set; }
public IAbpLazyServiceProvider LazyServiceProvider { get; set; } = default!;
[Obsolete("Use LazyServiceProvider instead.")]
public IServiceProvider ServiceProvider { get; set; }
public IServiceProvider ServiceProvider { get; set; } = default!;
public static string[] CommonPostfixes { get; set; } = { "AppService", "ApplicationService", "IntService", "IntegrationService", "Service" };
@ -49,7 +49,7 @@ public abstract class ApplicationService :
protected IAsyncQueryableExecuter AsyncExecuter => LazyServiceProvider.LazyGetRequiredService<IAsyncQueryableExecuter>();
protected Type ObjectMapperContext { get; set; }
protected Type? ObjectMapperContext { get; set; }
protected IObjectMapper ObjectMapper => LazyServiceProvider.LazyGetService<IObjectMapper>(provider =>
ObjectMapperContext == null
? provider.GetRequiredService<IObjectMapper>()
@ -85,34 +85,34 @@ public abstract class ApplicationService :
return _localizer;
}
}
private IStringLocalizer _localizer;
private IStringLocalizer? _localizer;
protected Type LocalizationResource {
protected Type? LocalizationResource {
get => _localizationResource;
set {
_localizationResource = value;
_localizer = null;
}
}
private Type _localizationResource = typeof(DefaultResource);
private Type? _localizationResource = typeof(DefaultResource);
protected IUnitOfWork CurrentUnitOfWork => UnitOfWorkManager?.Current;
protected IUnitOfWork? CurrentUnitOfWork => UnitOfWorkManager?.Current;
protected ILogger Logger => LazyServiceProvider.LazyGetService<ILogger>(provider => LoggerFactory?.CreateLogger(GetType().FullName) ?? NullLogger.Instance);
protected ILogger Logger => LazyServiceProvider.LazyGetService<ILogger>(provider => LoggerFactory?.CreateLogger(GetType().FullName!) ?? NullLogger.Instance);
/// <summary>
/// Checks for given <paramref name="policyName"/>.
/// Throws <see cref="AbpAuthorizationException"/> if given policy has not been granted.
/// </summary>
/// <param name="policyName">The policy name. This method does nothing if given <paramref name="policyName"/> is null or empty.</param>
protected virtual async Task CheckPolicyAsync([CanBeNull] string policyName)
protected virtual async Task CheckPolicyAsync(string? policyName)
{
if (string.IsNullOrEmpty(policyName))
{
return;
}
await AuthorizationService.CheckAsync(policyName);
await AuthorizationService.CheckAsync(policyName!);
}
protected virtual IStringLocalizer CreateLocalizer()

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;

3
framework/src/Volo.Abp.Ddd.Domain.Shared/Volo/Abp/Domain/Entities/Events/Distributed/IEntityToEtoMapper.cs

@ -4,6 +4,5 @@ namespace Volo.Abp.Domain.Entities.Events.Distributed;
public interface IEntityToEtoMapper
{
[CanBeNull]
object Map(object entityObj);
object? Map(object entityObj);
}

2
framework/src/Volo.Abp.Ddd.Domain/Volo.Abp.Ddd.Domain.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</AssemblyName>
<PackageId>Volo.Abp.Ddd.Domain</PackageId>
<AssetTargetFallback>$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;</AssetTargetFallback>

10
framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/DependencyInjection/AbpCommonDbContextRegistrationOptions.cs

@ -16,13 +16,13 @@ public abstract class AbpCommonDbContextRegistrationOptions : IAbpCommonDbContex
public IServiceCollection Services { get; }
public Dictionary<MultiTenantDbContextType, Type> ReplacedDbContextTypes { get; }
public Dictionary<MultiTenantDbContextType, Type?> ReplacedDbContextTypes { get; }
public Type DefaultRepositoryDbContextType { get; protected set; }
public Type DefaultRepositoryImplementationType { get; private set; }
public Type? DefaultRepositoryImplementationType { get; private set; }
public Type DefaultRepositoryImplementationTypeWithoutKey { get; private set; }
public Type? DefaultRepositoryImplementationTypeWithoutKey { get; private set; }
public bool RegisterDefaultRepositories { get; private set; }
@ -40,7 +40,7 @@ public abstract class AbpCommonDbContextRegistrationOptions : IAbpCommonDbContex
Services = services;
DefaultRepositoryDbContextType = originalDbContextType;
CustomRepositories = new Dictionary<Type, Type>();
ReplacedDbContextTypes = new Dictionary<MultiTenantDbContextType, Type>();
ReplacedDbContextTypes = new Dictionary<MultiTenantDbContextType, Type?>();
SpecifiedDefaultRepositories = new List<Type>();
}
@ -54,7 +54,7 @@ public abstract class AbpCommonDbContextRegistrationOptions : IAbpCommonDbContex
return ReplaceDbContext(typeof(TOtherDbContext), typeof(TTargetDbContext), multiTenancySides);
}
public IAbpCommonDbContextRegistrationOptionsBuilder ReplaceDbContext(Type otherDbContextType, Type targetDbContextType = null, MultiTenancySides multiTenancySides = MultiTenancySides.Both)
public IAbpCommonDbContextRegistrationOptionsBuilder ReplaceDbContext(Type otherDbContextType, Type? targetDbContextType = null, MultiTenancySides multiTenancySides = MultiTenancySides.Both)
{
if (!otherDbContextType.IsAssignableFrom(OriginalDbContextType))
{

2
framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/DependencyInjection/IAbpCommonDbContextRegistrationOptionsBuilder.cs

@ -90,5 +90,5 @@ public interface IAbpCommonDbContextRegistrationOptionsBuilder
/// <param name="otherDbContextType">The DbContext type to be replaced</param>
/// <param name="targetDbContextType">The target DbContext type (optional, used this DbContext type if not provided)</param>
/// <param name="multiTenancySides">MultiTenancy side</param>
IAbpCommonDbContextRegistrationOptionsBuilder ReplaceDbContext(Type otherDbContextType, Type targetDbContextType = null, MultiTenancySides multiTenancySides = MultiTenancySides.Both);
IAbpCommonDbContextRegistrationOptionsBuilder ReplaceDbContext(Type otherDbContextType, Type? targetDbContextType = null, MultiTenancySides multiTenancySides = MultiTenancySides.Both);
}

2
framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/DependencyInjection/MultiTenantDbContextType.cs

@ -15,7 +15,7 @@ public class MultiTenantDbContextType
MultiTenancySide = multiTenancySide;
}
public override bool Equals(object obj)
public override bool Equals(object? obj)
{
var other = obj as MultiTenantDbContextType;

8
framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Auditing/AuditedAggregateRootWithUser.cs

@ -12,10 +12,10 @@ public abstract class AuditedAggregateRootWithUser<TUser> : AuditedAggregateRoot
where TUser : IEntity<Guid>
{
/// <inheritdoc />
public virtual TUser Creator { get; protected set; }
public virtual TUser? Creator { get; protected set; }
/// <inheritdoc />
public virtual TUser LastModifier { get; set; }
public virtual TUser? LastModifier { get; set; }
}
/// <summary>
@ -28,10 +28,10 @@ public abstract class AuditedAggregateRootWithUser<TKey, TUser> : AuditedAggrega
where TUser : IEntity<Guid>
{
/// <inheritdoc />
public virtual TUser Creator { get; protected set; }
public virtual TUser? Creator { get; protected set; }
/// <inheritdoc />
public virtual TUser LastModifier { get; set; }
public virtual TUser? LastModifier { get; set; }
protected AuditedAggregateRootWithUser()
{

8
framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Auditing/AuditedEntityWithUser.cs

@ -12,10 +12,10 @@ public abstract class AuditedEntityWithUser<TUser> : AuditedEntity, IAuditedObje
where TUser : IEntity<Guid>
{
/// <inheritdoc />
public virtual TUser Creator { get; protected set; }
public virtual TUser? Creator { get; protected set; }
/// <inheritdoc />
public virtual TUser LastModifier { get; set; }
public virtual TUser? LastModifier { get; set; }
}
/// <summary>
@ -28,10 +28,10 @@ public abstract class AuditedEntityWithUser<TKey, TUser> : AuditedEntity<TKey>,
where TUser : IEntity<Guid>
{
/// <inheritdoc />
public virtual TUser Creator { get; protected set; }
public virtual TUser? Creator { get; protected set; }
/// <inheritdoc />
public virtual TUser LastModifier { get; set; }
public virtual TUser? LastModifier { get; set; }
protected AuditedEntityWithUser()
{

4
framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Auditing/CreationAuditedAggregateRootWithUser.cs

@ -11,7 +11,7 @@ namespace Volo.Abp.Domain.Entities.Auditing;
public abstract class CreationAuditedAggregateRootWithUser<TUser> : CreationAuditedAggregateRoot, ICreationAuditedObject<TUser>
{
/// <inheritdoc />
public virtual TUser Creator { get; protected set; }
public virtual TUser? Creator { get; protected set; }
}
/// <summary>
@ -23,7 +23,7 @@ public abstract class CreationAuditedAggregateRootWithUser<TUser> : CreationAudi
public abstract class CreationAuditedAggregateRootWithUser<TKey, TUser> : CreationAuditedAggregateRoot<TKey>, ICreationAuditedObject<TUser>
{
/// <inheritdoc />
public virtual TUser Creator { get; protected set; }
public virtual TUser? Creator { get; protected set; }
protected CreationAuditedAggregateRootWithUser()
{

4
framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Auditing/CreationAuditedEntityWithUser.cs

@ -11,7 +11,7 @@ namespace Volo.Abp.Domain.Entities.Auditing;
public abstract class CreationAuditedEntityWithUser<TUser> : CreationAuditedEntity, ICreationAuditedObject<TUser>
{
/// <inheritdoc />
public virtual TUser Creator { get; protected set; }
public virtual TUser? Creator { get; protected set; }
}
/// <summary>
@ -23,7 +23,7 @@ public abstract class CreationAuditedEntityWithUser<TUser> : CreationAuditedEnti
public abstract class CreationAuditedEntityWithUser<TKey, TUser> : CreationAuditedEntity<TKey>, ICreationAuditedObject<TUser>
{
/// <inheritdoc />
public virtual TUser Creator { get; protected set; }
public virtual TUser? Creator { get; protected set; }
protected CreationAuditedEntityWithUser()
{

12
framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Auditing/FullAuditedAggregateRootWithUser.cs

@ -12,13 +12,13 @@ public abstract class FullAuditedAggregateRootWithUser<TUser> : FullAuditedAggre
where TUser : IEntity<Guid>
{
/// <inheritdoc />
public virtual TUser Deleter { get; set; }
public virtual TUser? Deleter { get; set; }
/// <inheritdoc />
public virtual TUser Creator { get; protected set; }
public virtual TUser? Creator { get; protected set; }
/// <inheritdoc />
public virtual TUser LastModifier { get; set; }
public virtual TUser? LastModifier { get; set; }
}
/// <summary>
@ -31,13 +31,13 @@ public abstract class FullAuditedAggregateRootWithUser<TKey, TUser> : FullAudite
where TUser : IEntity<Guid>
{
/// <inheritdoc />
public virtual TUser Deleter { get; set; }
public virtual TUser? Deleter { get; set; }
/// <inheritdoc />
public virtual TUser Creator { get; protected set; }
public virtual TUser? Creator { get; protected set; }
/// <inheritdoc />
public virtual TUser LastModifier { get; set; }
public virtual TUser? LastModifier { get; set; }
protected FullAuditedAggregateRootWithUser()
{

12
framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Auditing/FullAuditedEntityWithUser.cs

@ -12,13 +12,13 @@ public abstract class FullAuditedEntityWithUser<TUser> : FullAuditedEntity, IFul
where TUser : IEntity<Guid>
{
/// <inheritdoc />
public virtual TUser Deleter { get; set; }
public virtual TUser? Deleter { get; set; }
/// <inheritdoc />
public virtual TUser Creator { get; protected set; }
public virtual TUser? Creator { get; protected set; }
/// <inheritdoc />
public virtual TUser LastModifier { get; set; }
public virtual TUser? LastModifier { get; set; }
}
/// <summary>
@ -31,13 +31,13 @@ public abstract class FullAuditedEntityWithUser<TKey, TUser> : FullAuditedEntity
where TUser : IEntity<Guid>
{
/// <inheritdoc />
public virtual TUser Deleter { get; set; }
public virtual TUser? Deleter { get; set; }
/// <inheritdoc />
public virtual TUser Creator { get; protected set; }
public virtual TUser? Creator { get; protected set; }
/// <inheritdoc />
public virtual TUser LastModifier { get; set; }
public virtual TUser? LastModifier { get; set; }
protected FullAuditedEntityWithUser()
{

12
framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Caching/EntityCacheBase.cs

@ -27,23 +27,23 @@ public abstract class EntityCacheBase<TEntity, TEntityCacheItem, TKey> :
UnitOfWorkManager = unitOfWorkManager;
}
public virtual async Task<TEntityCacheItem> FindAsync(TKey id)
public virtual async Task<TEntityCacheItem?> FindAsync(TKey id)
{
return await Cache.GetOrAddAsync(
id,
async () => MapToCacheItem(await Repository.FindAsync(id))
async () => MapToCacheItem(await Repository.FindAsync(id))!
);
}
public virtual async Task<TEntityCacheItem> GetAsync(TKey id)
{
return await Cache.GetOrAddAsync(
return (await Cache.GetOrAddAsync(
id,
async () => MapToCacheItem(await Repository.GetAsync(id))
);
async () => MapToCacheItem(await Repository.GetAsync(id))!
))!;
}
protected abstract TEntityCacheItem MapToCacheItem(TEntity entity);
protected abstract TEntityCacheItem? MapToCacheItem(TEntity? entity);
public async Task HandleEventAsync(EntityChangedEventData<TEntity> eventData)
{

6
framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Caching/EntityCacheServiceCollectionExtensions.cs

@ -13,7 +13,7 @@ public static class EntityCacheServiceCollectionExtensions
{
public static IServiceCollection AddEntityCache<TEntity, TKey>(
this IServiceCollection services,
[CanBeNull] DistributedCacheEntryOptions cacheOptions = null)
DistributedCacheEntryOptions? cacheOptions = null)
where TEntity : Entity<TKey>
{
services
@ -39,7 +39,7 @@ public static class EntityCacheServiceCollectionExtensions
public static IServiceCollection AddEntityCache<TEntity, TEntityCacheItem, TKey>(
this IServiceCollection services,
[CanBeNull] DistributedCacheEntryOptions cacheOptions = null)
DistributedCacheEntryOptions? cacheOptions = null)
where TEntity : Entity<TKey>
where TEntityCacheItem : class
{
@ -61,7 +61,7 @@ public static class EntityCacheServiceCollectionExtensions
public static IServiceCollection AddEntityCache<TObjectMapperContext, TEntity, TEntityCacheItem, TKey>(
this IServiceCollection services,
[CanBeNull] DistributedCacheEntryOptions cacheOptions = null)
DistributedCacheEntryOptions? cacheOptions = null)
where TEntity : Entity<TKey>
where TEntityCacheItem : class
{

2
framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Caching/EntityCacheWithObjectMapper.cs

@ -23,7 +23,7 @@ public class EntityCacheWithObjectMapper<TEntity, TEntityCacheItem, TKey> :
ObjectMapper = objectMapper;
}
protected override TEntityCacheItem MapToCacheItem(TEntity entity)
protected override TEntityCacheItem? MapToCacheItem(TEntity? entity)
{
if (entity == null)
{

2
framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Caching/EntityCacheWithoutCacheItem.cs

@ -16,7 +16,7 @@ public class EntityCacheWithoutCacheItem<TEntity, TKey> :
{
}
protected override TEntity MapToCacheItem(TEntity entity)
protected override TEntity? MapToCacheItem(TEntity? entity)
{
return entity;
}

3
framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Caching/IEntityCache.cs

@ -10,8 +10,7 @@ public interface IEntityCache<TEntityCacheItem, in TKey>
/// Gets the entity with given <paramref name="id"/>,
/// or returns null if the entity was not found.
/// </summary>
[ItemCanBeNull]
Task<TEntityCacheItem> FindAsync(TKey id);
Task<TEntityCacheItem?> FindAsync(TKey id);
/// <summary>
/// Gets the entity with given <paramref name="id"/>,

8
framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Entity.cs

@ -18,7 +18,7 @@ public abstract class Entity : IEntity
return $"[ENTITY: {GetType().Name}] Keys = {GetKeys().JoinAsString(", ")}";
}
public abstract object[] GetKeys();
public abstract object?[] GetKeys();
public bool EntityEquals(IEntity other)
{
@ -31,7 +31,7 @@ public abstract class Entity : IEntity
public abstract class Entity<TKey> : Entity, IEntity<TKey>
{
/// <inheritdoc/>
public virtual TKey Id { get; protected set; }
public virtual TKey Id { get; protected set; } = default!;
protected Entity()
{
@ -43,9 +43,9 @@ public abstract class Entity<TKey> : Entity, IEntity<TKey>
Id = id;
}
public override object[] GetKeys()
public override object?[] GetKeys()
{
return new object[] { Id };
return new object?[] { Id };
}
/// <inheritdoc/>

16
framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/EntityHelper.cs

@ -25,7 +25,7 @@ public static class EntityHelper
return typeof(IMultiTenant).IsAssignableFrom(type);
}
public static bool EntityEquals(IEntity entity1, IEntity entity2)
public static bool EntityEquals(IEntity? entity1, IEntity? entity2)
{
if (entity1 == null || entity2 == null)
{
@ -131,7 +131,7 @@ public static class EntityHelper
return IsValueObjectPredicate(type);
}
public static bool IsValueObject(object obj)
public static bool IsValueObject(object? obj)
{
return obj != null && IsValueObject(obj.GetType());
}
@ -161,7 +161,7 @@ public static class EntityHelper
public static bool HasDefaultId<TKey>(IEntity<TKey> entity)
{
if (EqualityComparer<TKey>.Default.Equals(entity.Id, default))
if (EqualityComparer<TKey>.Default.Equals(entity.Id, default!))
{
return true;
}
@ -180,7 +180,7 @@ public static class EntityHelper
return false;
}
private static bool IsDefaultKeyValue(object value)
private static bool IsDefaultKeyValue(object? value)
{
if (value == null)
{
@ -222,8 +222,7 @@ public static class EntityHelper
/// Tries to find the primary key type of the given entity type.
/// May return null if given type does not implement <see cref="IEntity{TKey}"/>
/// </summary>
[CanBeNull]
public static Type FindPrimaryKeyType<TEntity>()
public static Type? FindPrimaryKeyType<TEntity>()
where TEntity : IEntity
{
return FindPrimaryKeyType(typeof(TEntity));
@ -233,8 +232,7 @@ public static class EntityHelper
/// Tries to find the primary key type of the given entity type.
/// May return null if given type does not implement <see cref="IEntity{TKey}"/>
/// </summary>
[CanBeNull]
public static Type FindPrimaryKeyType([NotNull] Type entityType)
public static Type? FindPrimaryKeyType([NotNull] Type entityType)
{
if (!typeof(IEntity).IsAssignableFrom(entityType))
{
@ -260,7 +258,7 @@ public static class EntityHelper
var lambdaParam = Expression.Parameter(typeof(TEntity));
var leftExpression = Expression.PropertyOrField(lambdaParam, "Id");
var idValue = Convert.ChangeType(id, typeof(TKey));
Expression<Func<object>> closure = () => idValue;
Expression<Func<object?>> closure = () => idValue;
var rightExpression = Expression.Convert(closure.Body, leftExpression.Type);
var lambdaBody = Expression.Equal(leftExpression, rightExpression);
return Expression.Lambda<Func<TEntity, bool>>(lambdaBody, lambdaParam);

7
framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Events/Distributed/EntitySynchronizer.cs

@ -22,7 +22,7 @@ public abstract class EntitySynchronizer<TEntity, TKey, TSourceEntityEto> :
Repository = repository;
}
protected override Task<TEntity> FindLocalEntityAsync(TSourceEntityEto eto)
protected override Task<TEntity?> FindLocalEntityAsync(TSourceEntityEto eto)
{
return Repository.FindAsync(eto.Id);
}
@ -154,10 +154,9 @@ public abstract class EntitySynchronizer<TEntity, TSourceEntityEto> :
return true;
}
[ItemCanBeNull]
protected abstract Task<TEntity> FindLocalEntityAsync(TSourceEntityEto eto);
protected abstract Task<TEntity?> FindLocalEntityAsync(TSourceEntityEto eto);
protected virtual Task<bool> IsEtoNewerAsync(TSourceEntityEto eto, [CanBeNull] TEntity localEntity)
protected virtual Task<bool> IsEtoNewerAsync(TSourceEntityEto eto, TEntity? localEntity)
{
if (localEntity is IHasEntityVersion versionedLocalEntity && eto is IHasEntityVersion versionedEto)
{

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

@ -21,7 +21,7 @@ public class EntityToEtoMapper : IEntityToEtoMapper, ITransientDependency
Options = options.Value;
}
public object Map(object entityObj)
public object? Map(object entityObj)
{
Check.NotNull(entityObj, nameof(entityObj));
@ -36,7 +36,7 @@ public class EntityToEtoMapper : IEntityToEtoMapper, ITransientDependency
if (etoMappingItem == null)
{
var keys = entity.GetKeys().JoinAsString(",");
return new EntityEto(entityType.FullName, keys);
return new EntityEto(entityType.FullName!, keys);
}
using (var scope = HybridServiceScopeFactory.CreateScope())

2
framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Events/EntityChangeEventHelper.cs

@ -133,7 +133,7 @@ public class EntityChangeEventHelper : IEntityChangeEventHelper, ITransientDepen
{
var entityType = ProxyHelper.UnProxy(entityOrEto).GetType();
var eventType = genericEventType.MakeGenericType(entityType);
var eventData = Activator.CreateInstance(eventType, entityOrEto);
var eventData = Activator.CreateInstance(eventType, entityOrEto)!;
var currentUow = UnitOfWorkManager.Current;
if (currentUow == null)

2
framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/Events/EntityEventData.cs

@ -27,7 +27,7 @@ public class EntityEventData<TEntity> : IEventDataWithInheritableGenericArgument
public virtual object[] GetConstructorArgs()
{
return new object[] { Entity };
return new object[] { Entity! };
}
public virtual bool IsMultiTenant(out Guid? tenantId)

2
framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Entities/IEntity.cs

@ -10,7 +10,7 @@ public interface IEntity
/// Returns an array of ordered keys for this entity.
/// </summary>
/// <returns></returns>
object[] GetKeys();
object?[] GetKeys();
}
/// <summary>

6
framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Repositories/BasicRepositoryBase.cs

@ -20,9 +20,9 @@ public abstract class BasicRepositoryBase<TEntity> :
IUnitOfWorkEnabled
where TEntity : class, IEntity
{
public IAbpLazyServiceProvider LazyServiceProvider { get; set; }
public IAbpLazyServiceProvider LazyServiceProvider { get; set; } = default!;
public IServiceProvider ServiceProvider { get; set; }
public IServiceProvider ServiceProvider { get; set; } = default!;
public IDataFilter DataFilter => LazyServiceProvider.LazyGetRequiredService<IDataFilter>();
@ -123,7 +123,7 @@ public abstract class BasicRepositoryBase<TEntity, TKey> : BasicRepositoryBase<T
return entity;
}
public abstract Task<TEntity> FindAsync(TKey id, bool includeDetails = true, CancellationToken cancellationToken = default);
public abstract Task<TEntity?> FindAsync(TKey id, bool includeDetails = true, CancellationToken cancellationToken = default);
public virtual async Task DeleteAsync(TKey id, bool autoSave = false, CancellationToken cancellationToken = default)
{

2
framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Repositories/IReadOnlyBasicRepository.cs

@ -51,5 +51,5 @@ public interface IReadOnlyBasicRepository<TEntity, TKey> : IReadOnlyBasicReposit
/// <param name="includeDetails">Set true to include all children of this entity</param>
/// <param name="cancellationToken">A <see cref="T:System.Threading.CancellationToken" /> to observe while waiting for the task to complete.</param>
/// <returns>Entity or null</returns>
Task<TEntity> FindAsync(TKey id, bool includeDetails = true, CancellationToken cancellationToken = default);
Task<TEntity?> FindAsync(TKey id, bool includeDetails = true, CancellationToken cancellationToken = default);
}

2
framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Repositories/IRepository.cs

@ -28,7 +28,7 @@ public interface IRepository<TEntity> : IReadOnlyRepository<TEntity>, IBasicRepo
/// <param name="predicate">A condition to find the entity</param>
/// <param name="includeDetails">Set true to include all children of this entity</param>
/// <param name="cancellationToken">A <see cref="T:System.Threading.CancellationToken" /> to observe while waiting for the task to complete.</param>
Task<TEntity> FindAsync(
Task<TEntity?> FindAsync(
[NotNull] Expression<Func<TEntity, bool>> predicate,
bool includeDetails = true,
CancellationToken cancellationToken = default

12
framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Repositories/RepositoryAsyncExtensions.cs

@ -120,7 +120,7 @@ public static class RepositoryAsyncExtensions
return await repository.AsyncExecuter.FirstAsync(queryable, predicate, cancellationToken);
}
public static async Task<T> FirstOrDefaultAsync<T>(
public static async Task<T?> FirstOrDefaultAsync<T>(
[NotNull] this IReadOnlyRepository<T> repository,
CancellationToken cancellationToken = default)
where T : class, IEntity
@ -129,7 +129,7 @@ public static class RepositoryAsyncExtensions
return await repository.AsyncExecuter.FirstOrDefaultAsync(queryable, cancellationToken);
}
public static async Task<T> FirstOrDefaultAsync<T>(
public static async Task<T?> FirstOrDefaultAsync<T>(
[NotNull] this IReadOnlyRepository<T> repository,
[NotNull] Expression<Func<T, bool>> predicate,
CancellationToken cancellationToken = default)
@ -162,7 +162,7 @@ public static class RepositoryAsyncExtensions
return await repository.AsyncExecuter.LastAsync(queryable, predicate, cancellationToken);
}
public static async Task<T> LastOrDefaultAsync<T>(
public static async Task<T?> LastOrDefaultAsync<T>(
[NotNull] this IReadOnlyRepository<T> repository,
CancellationToken cancellationToken = default)
where T : class, IEntity
@ -171,7 +171,7 @@ public static class RepositoryAsyncExtensions
return await repository.AsyncExecuter.LastOrDefaultAsync(queryable, cancellationToken);
}
public static async Task<T> LastOrDefaultAsync<T>(
public static async Task<T?> LastOrDefaultAsync<T>(
[NotNull] this IReadOnlyRepository<T> repository,
[NotNull] Expression<Func<T, bool>> predicate,
CancellationToken cancellationToken = default)
@ -204,7 +204,7 @@ public static class RepositoryAsyncExtensions
return await repository.AsyncExecuter.SingleAsync(queryable, predicate, cancellationToken);
}
public static async Task<T> SingleOrDefaultAsync<T>(
public static async Task<T?> SingleOrDefaultAsync<T>(
[NotNull] this IReadOnlyRepository<T> repository,
CancellationToken cancellationToken = default)
where T : class, IEntity
@ -213,7 +213,7 @@ public static class RepositoryAsyncExtensions
return await repository.AsyncExecuter.SingleOrDefaultAsync(queryable, cancellationToken);
}
public static async Task<T> SingleOrDefaultAsync<T>(
public static async Task<T?> SingleOrDefaultAsync<T>(
[NotNull] this IReadOnlyRepository<T> repository,
[NotNull] Expression<Func<T, bool>> predicate,
CancellationToken cancellationToken = default)

8
framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Repositories/RepositoryBase.cs

@ -41,7 +41,7 @@ public abstract class RepositoryBase<TEntity> : BasicRepositoryBase<TEntity>, IR
public abstract Task<IQueryable<TEntity>> GetQueryableAsync();
public abstract Task<TEntity> FindAsync(
public abstract Task<TEntity?> FindAsync(
Expression<Func<TEntity, bool>> predicate,
bool includeDetails = true,
CancellationToken cancellationToken = default);
@ -76,13 +76,13 @@ public abstract class RepositoryBase<TEntity> : BasicRepositoryBase<TEntity>, IR
{
if (typeof(ISoftDelete).IsAssignableFrom(typeof(TOtherEntity)))
{
query = (TQueryable)query.WhereIf(DataFilter.IsEnabled<ISoftDelete>(), e => ((ISoftDelete)e).IsDeleted == false);
query = (TQueryable)query.WhereIf(DataFilter.IsEnabled<ISoftDelete>(), e => ((ISoftDelete)e!).IsDeleted == false);
}
if (typeof(IMultiTenant).IsAssignableFrom(typeof(TOtherEntity)))
{
var tenantId = CurrentTenant.Id;
query = (TQueryable)query.WhereIf(DataFilter.IsEnabled<IMultiTenant>(), e => ((IMultiTenant)e).TenantId == tenantId);
query = (TQueryable)query.WhereIf(DataFilter.IsEnabled<IMultiTenant>(), e => ((IMultiTenant)e!).TenantId == tenantId);
}
return query;
@ -94,7 +94,7 @@ public abstract class RepositoryBase<TEntity, TKey> : RepositoryBase<TEntity>, I
{
public abstract Task<TEntity> GetAsync(TKey id, bool includeDetails = true, CancellationToken cancellationToken = default);
public abstract Task<TEntity> FindAsync(TKey id, bool includeDetails = true, CancellationToken cancellationToken = default);
public abstract Task<TEntity?> FindAsync(TKey id, bool includeDetails = true, CancellationToken cancellationToken = default);
public virtual async Task DeleteAsync(TKey id, bool autoSave = false, CancellationToken cancellationToken = default)
{

8
framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Repositories/RepositoryExtensions.cs

@ -54,7 +54,7 @@ public static class RepositoryExtensions
)
where TEntity : class, IEntity<TKey>
{
if (!await repository.AnyAsync(x => x.Id.Equals(id), cancellationToken))
if (!await repository.AnyAsync(x => x.Id!.Equals(id), cancellationToken))
{
throw new EntityNotFoundException(typeof(TEntity), id);
}
@ -87,7 +87,7 @@ public static class RepositoryExtensions
{
using (var uow = uowManager.Begin())
{
await HardDeleteWithUnitOfWorkAsync(repository, predicate, autoSave, cancellationToken, uowManager.Current);
await HardDeleteWithUnitOfWorkAsync(repository, predicate, autoSave, cancellationToken, uowManager.Current!);
await uow.CompleteAsync(cancellationToken);
}
}
@ -111,7 +111,7 @@ public static class RepositoryExtensions
{
using (var uow = uowManager.Begin())
{
await HardDeleteWithUnitOfWorkAsync(repository, entities, autoSave, cancellationToken, uowManager.Current);
await HardDeleteWithUnitOfWorkAsync(repository, entities, autoSave, cancellationToken, uowManager.Current!);
await uow.CompleteAsync(cancellationToken);
}
}
@ -135,7 +135,7 @@ public static class RepositoryExtensions
{
using (var uow = uowManager.Begin())
{
await HardDeleteWithUnitOfWorkAsync(repository, entity, autoSave, cancellationToken, uowManager.Current);
await HardDeleteWithUnitOfWorkAsync(repository, entity, autoSave, cancellationToken, uowManager.Current!);
await uow.CompleteAsync(cancellationToken);
}
}

4
framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Repositories/RepositoryRegistrarBase.cs

@ -75,12 +75,12 @@ public abstract class RepositoryRegistrarBase<TOptions>
if (primaryKeyType == null)
{
return Options.SpecifiedDefaultRepositoryTypes
? Options.DefaultRepositoryImplementationTypeWithoutKey.MakeGenericType(entityType)
? Options.DefaultRepositoryImplementationTypeWithoutKey!.MakeGenericType(entityType)
: GetRepositoryType(Options.DefaultRepositoryDbContextType, entityType);
}
return Options.SpecifiedDefaultRepositoryTypes
? Options.DefaultRepositoryImplementationType.MakeGenericType(entityType, primaryKeyType)
? Options.DefaultRepositoryImplementationType!.MakeGenericType(entityType, primaryKeyType)
: GetRepositoryType(Options.DefaultRepositoryDbContextType, entityType, primaryKeyType);
}

6
framework/src/Volo.Abp.Ddd.Domain/Volo/Abp/Domain/Services/DomainService.cs

@ -11,10 +11,10 @@ namespace Volo.Abp.Domain.Services;
public abstract class DomainService : IDomainService
{
public IAbpLazyServiceProvider LazyServiceProvider { get; set; }
public IAbpLazyServiceProvider LazyServiceProvider { get; set; } = default!;
[Obsolete("Use LazyServiceProvider instead.")]
public IServiceProvider ServiceProvider { get; set; }
public IServiceProvider ServiceProvider { get; set; } = default!;
protected IClock Clock => LazyServiceProvider.LazyGetRequiredService<IClock>();
@ -26,5 +26,5 @@ public abstract class DomainService : IDomainService
protected IAsyncQueryableExecuter AsyncExecuter => LazyServiceProvider.LazyGetRequiredService<IAsyncQueryableExecuter>();
protected ILogger Logger => LazyServiceProvider.LazyGetService<ILogger>(provider => LoggerFactory?.CreateLogger(GetType().FullName) ?? NullLogger.Instance);
protected ILogger Logger => LazyServiceProvider.LazyGetService<ILogger>(provider => LoggerFactory?.CreateLogger(GetType().FullName!) ?? NullLogger.Instance);
}

2
framework/src/Volo.Abp.DistributedLocking.Abstractions/Volo.Abp.DistributedLocking.Abstractions.csproj

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

3
framework/src/Volo.Abp.DistributedLocking.Abstractions/Volo/Abp/DistributedLocking/IAbpDistributedLock.cs

@ -16,8 +16,7 @@ public interface IAbpDistributedLock
/// <param name="name">The name of the lock</param>
/// <param name="timeout">How long to wait before giving up on the acquisition attempt. Defaults to 0</param>
/// <param name="cancellationToken">Cancellation token</param>
[ItemCanBeNull]
Task<IAbpDistributedLockHandle> TryAcquireAsync(
Task<IAbpDistributedLockHandle?> TryAcquireAsync(
[NotNull] string name,
TimeSpan timeout = default,
CancellationToken cancellationToken = default

2
framework/src/Volo.Abp.DistributedLocking.Abstractions/Volo/Abp/DistributedLocking/LocalAbpDistributedLock.cs

@ -22,7 +22,7 @@ public class LocalAbpDistributedLock : IAbpDistributedLock, ISingletonDependency
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public async Task<IAbpDistributedLockHandle> TryAcquireAsync(
public async Task<IAbpDistributedLockHandle?> TryAcquireAsync(
string name,
TimeSpan timeout = default,
CancellationToken cancellationToken = default)

2
framework/src/Volo.Abp.DistributedLocking.Dapr/Volo.Abp.DistributedLocking.Dapr.csproj

@ -5,6 +5,8 @@
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<WarningsAsErrors>Nullable</WarningsAsErrors>
<RootNamespace />
</PropertyGroup>

2
framework/src/Volo.Abp.DistributedLocking.Dapr/Volo/Abp/DistributedLocking/Dapr/AbpDistributedLockDaprOptions.cs

@ -4,7 +4,7 @@ namespace Volo.Abp.DistributedLocking.Dapr;
public class AbpDistributedLockDaprOptions
{
public string StoreName { get; set; }
public string StoreName { get; set; } = default!;
public string? Owner { get; set; }

2
framework/src/Volo.Abp.DistributedLocking.Dapr/Volo/Abp/DistributedLocking/Dapr/DaprAbpDistributedLock.cs

@ -24,7 +24,7 @@ public class DaprAbpDistributedLock : IAbpDistributedLock, ITransientDependency
DistributedLockDaprOptions = distributedLockDaprOptions.Value;
}
public async Task<IAbpDistributedLockHandle> TryAcquireAsync(
public async Task<IAbpDistributedLockHandle?> TryAcquireAsync(
string name,
TimeSpan timeout = default,
CancellationToken cancellationToken = default)

2
framework/src/Volo.Abp.DistributedLocking/Volo.Abp.DistributedLocking.csproj

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

2
framework/src/Volo.Abp.DistributedLocking/Volo/Abp/DistributedLocking/MedallionAbpDistributedLock.cs

@ -25,7 +25,7 @@ public class MedallionAbpDistributedLock : IAbpDistributedLock, ITransientDepend
DistributedLockKeyNormalizer = distributedLockKeyNormalizer;
}
public async Task<IAbpDistributedLockHandle> TryAcquireAsync(
public async Task<IAbpDistributedLockHandle?> TryAcquireAsync(
string name,
TimeSpan timeout = default,
CancellationToken cancellationToken = default)

8
framework/src/Volo.Abp.Threading/Volo/Abp/Linq/AsyncQueryableExecuter.cs

@ -209,7 +209,7 @@ public class AsyncQueryableExecuter : IAsyncQueryableExecuter, ISingletonDepende
return Task.FromResult(queryable.SingleOrDefault(predicate))!;
}
public Task<T?> MinAsync<T>(IQueryable<T> queryable, CancellationToken cancellationToken = default)
public Task<T> MinAsync<T>(IQueryable<T> queryable, CancellationToken cancellationToken = default)
{
var provider = FindProvider(queryable);
@ -221,7 +221,7 @@ public class AsyncQueryableExecuter : IAsyncQueryableExecuter, ISingletonDepende
return Task.FromResult(queryable.Min())!;
}
public Task<TResult?> MinAsync<T, TResult>(IQueryable<T> queryable, Expression<Func<T, TResult>> selector, CancellationToken cancellationToken = default)
public Task<TResult> MinAsync<T, TResult>(IQueryable<T> queryable, Expression<Func<T, TResult>> selector, CancellationToken cancellationToken = default)
{
var provider = FindProvider(queryable);
@ -233,7 +233,7 @@ public class AsyncQueryableExecuter : IAsyncQueryableExecuter, ISingletonDepende
return Task.FromResult(queryable.Min(selector))!;
}
public Task<T?> MaxAsync<T>(IQueryable<T> queryable, CancellationToken cancellationToken = default)
public Task<T> MaxAsync<T>(IQueryable<T> queryable, CancellationToken cancellationToken = default)
{
var provider = FindProvider(queryable);
@ -245,7 +245,7 @@ public class AsyncQueryableExecuter : IAsyncQueryableExecuter, ISingletonDepende
return Task.FromResult(queryable.Max())!;
}
public Task<TResult?> MaxAsync<T, TResult>(IQueryable<T> queryable, Expression<Func<T, TResult>> selector, CancellationToken cancellationToken = default)
public Task<TResult> MaxAsync<T, TResult>(IQueryable<T> queryable, Expression<Func<T, TResult>> selector, CancellationToken cancellationToken = default)
{
var provider = FindProvider(queryable);

8
framework/src/Volo.Abp.Threading/Volo/Abp/Linq/IAsyncQueryableExecuter.cs

@ -137,12 +137,12 @@ public interface IAsyncQueryableExecuter
#region Min
Task<T?> MinAsync<T>(
Task<T> MinAsync<T>(
[NotNull] IQueryable<T> queryable,
CancellationToken cancellationToken = default);
Task<TResult?> MinAsync<T, TResult>(
Task<TResult> MinAsync<T, TResult>(
[NotNull] IQueryable<T> queryable,
[NotNull] Expression<Func<T, TResult>> selector,
CancellationToken cancellationToken = default);
@ -151,12 +151,12 @@ public interface IAsyncQueryableExecuter
#region Max
Task<T?> MaxAsync<T>(
Task<T> MaxAsync<T>(
[NotNull] IQueryable<T> queryable,
CancellationToken cancellationToken = default);
Task<TResult?> MaxAsync<T, TResult>(
Task<TResult> MaxAsync<T, TResult>(
[NotNull] IQueryable<T> queryable,
[NotNull] Expression<Func<T, TResult>> selector,
CancellationToken cancellationToken = default);

8
framework/src/Volo.Abp.Threading/Volo/Abp/Linq/IAsyncQueryableProvider.cs

@ -139,12 +139,12 @@ public interface IAsyncQueryableProvider
#region Min
Task<T?> MinAsync<T>(
Task<T> MinAsync<T>(
[NotNull] IQueryable<T> queryable,
CancellationToken cancellationToken = default);
Task<TResult?> MinAsync<T, TResult>(
Task<TResult> MinAsync<T, TResult>(
[NotNull] IQueryable<T> queryable,
[NotNull] Expression<Func<T, TResult>> selector,
CancellationToken cancellationToken = default);
@ -153,12 +153,12 @@ public interface IAsyncQueryableProvider
#region Max
Task<T?> MaxAsync<T>(
Task<T> MaxAsync<T>(
[NotNull] IQueryable<T> queryable,
CancellationToken cancellationToken = default);
Task<TResult?> MaxAsync<T, TResult>(
Task<TResult> MaxAsync<T, TResult>(
[NotNull] IQueryable<T> queryable,
[NotNull] Expression<Func<T, TResult>> selector,
CancellationToken cancellationToken = default);

Loading…
Cancel
Save