Browse Source

Enable nullable annotations for Volo.Abp.Emailing

pull/17108/head
liangshiwei 3 years ago
parent
commit
fb90f74713
  1. 2
      framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/GlobalFeatures/GlobalFeatureActionFilter.cs
  2. 2
      framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/GlobalFeatures/GlobalFeaturePageFilter.cs
  3. 2
      framework/src/Volo.Abp.Emailing/Volo.Abp.Emailing.csproj
  4. 2
      framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/EmailSenderConfiguration.cs
  5. 2
      framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/Smtp/ISmtpEmailSenderConfiguration.cs
  6. 2
      framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/Smtp/SmtpEmailSenderConfiguration.cs

2
framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/GlobalFeatures/GlobalFeatureActionFilter.cs

@ -24,7 +24,7 @@ public class GlobalFeatureActionFilter : IAsyncActionFilter, ITransientDependenc
if (!GlobalFeatureHelper.IsGlobalFeatureEnabled(context.Controller.GetType(), out var attribute))
{
var logger = context.GetService<ILogger<GlobalFeatureActionFilter>>(NullLogger<GlobalFeatureActionFilter>.Instance)!;
logger.LogWarning($"The '{context.Controller.GetType().FullName}' controller needs to enable '{attribute.Name}' feature.");
logger.LogWarning($"The '{context.Controller.GetType().FullName}' controller needs to enable '{attribute!.Name}' feature.");
context.Result = new NotFoundResult();
return;
}

2
framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/GlobalFeatures/GlobalFeaturePageFilter.cs

@ -29,7 +29,7 @@ public class GlobalFeaturePageFilter : IAsyncPageFilter, ITransientDependency
if (!GlobalFeatureHelper.IsGlobalFeatureEnabled(context.HandlerInstance.GetType(), out var attribute))
{
var logger = context.GetService<ILogger<GlobalFeatureActionFilter>>(NullLogger<GlobalFeatureActionFilter>.Instance)!;
logger.LogWarning($"The '{context.HandlerInstance.GetType().FullName}' page needs to enable '{attribute.Name}' feature.");
logger.LogWarning($"The '{context.HandlerInstance.GetType().FullName}' page needs to enable '{attribute!.Name}' feature.");
context.Result = new NotFoundResult();
return;
}

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

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

2
framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/EmailSenderConfiguration.cs

@ -44,6 +44,6 @@ public abstract class EmailSenderConfiguration : IEmailSenderConfiguration
throw new AbpException($"Setting value for '{name}' is null or empty!");
}
return value;
return value!;
}
}

2
framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/Smtp/ISmtpEmailSenderConfiguration.cs

@ -30,7 +30,7 @@ public interface ISmtpEmailSenderConfiguration : IEmailSenderConfiguration
/// <summary>
/// Domain name to login to SMTP server.
/// </summary>
Task<string> GetDomainAsync();
Task<string?> GetDomainAsync();
/// <summary>
/// Is SSL enabled?

2
framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/Smtp/SmtpEmailSenderConfiguration.cs

@ -37,7 +37,7 @@ public class SmtpEmailSenderConfiguration : EmailSenderConfiguration, ISmtpEmail
return GetNotEmptySettingValueAsync(EmailSettingNames.Smtp.Password);
}
public Task<string> GetDomainAsync()
public Task<string?> GetDomainAsync()
{
return SettingProvider.GetOrNullAsync(EmailSettingNames.Smtp.Domain);
}

Loading…
Cancel
Save