Merge pull request #17478 from abpframework/Eliminate-nullable-warnings

Eliminate nullable warnings.
pull/17485/head
liangshiwei 1 year ago committed by GitHub
commit a3f68f9b81
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -197,7 +197,7 @@ public class MyProjectNameHostModule : AbpModule
private void ConfigureSwagger(IServiceCollection services, IConfiguration configuration)
{
services.AddAbpSwaggerGenWithOAuth(
configuration["AuthServer:Authority"],
configuration["AuthServer:Authority"]!,
new Dictionary<string, string>
{
{"MyProjectName", "MyProjectName API"}

@ -200,7 +200,7 @@ public class MyProjectNameHostModule : AbpModule
private void ConfigureSwagger(IServiceCollection services, IConfiguration configuration)
{
services.AddAbpSwaggerGenWithOAuth(
configuration["AuthServer:Authority"],
configuration["AuthServer:Authority"]!,
new Dictionary<string, string>
{
{"MyProjectName", "MyProjectName API"}

@ -241,7 +241,7 @@ public class MyProjectNameModule : AbpModule
private void ConfigureSwagger(IServiceCollection services, IConfiguration configuration)
{
services.AddAbpSwaggerGenWithOAuth(
configuration["AuthServer:Authority"],
configuration["AuthServer:Authority"]!,
new Dictionary<string, string>
{
{"MyProjectName", "MyProjectName API"}

@ -244,7 +244,7 @@ public class MyProjectNameModule : AbpModule
private void ConfigureSwagger(IServiceCollection services, IConfiguration configuration)
{
services.AddAbpSwaggerGenWithOAuth(
configuration["AuthServer:Authority"],
configuration["AuthServer:Authority"]!,
new Dictionary<string, string>
{
{"MyProjectName", "MyProjectName API"}

@ -133,14 +133,13 @@ public class MyProjectNameAuthServerModule : AbpModule
var dataProtectionBuilder = context.Services.AddDataProtection().SetApplicationName("MyProjectName");
if (!hostingEnvironment.IsDevelopment())
{
var redis = ConnectionMultiplexer.Connect(configuration["Redis:Configuration"]);
var redis = ConnectionMultiplexer.Connect(configuration["Redis:Configuration"]!);
dataProtectionBuilder.PersistKeysToStackExchangeRedis(redis, "MyProjectName-Protection-Keys");
}
context.Services.AddSingleton<IDistributedLockProvider>(sp =>
{
var connection = ConnectionMultiplexer
.Connect(configuration["Redis:Configuration"]);
var connection = ConnectionMultiplexer.Connect(configuration["Redis:Configuration"]!);
return new RedisDistributedSynchronizationProvider(connection.GetDatabase());
});

@ -265,7 +265,7 @@ public class MyProjectNameBlazorModule : AbpModule
var dataProtectionBuilder = context.Services.AddDataProtection().SetApplicationName("MyProjectName");
if (!hostingEnvironment.IsDevelopment())
{
var redis = ConnectionMultiplexer.Connect(configuration["Redis:Configuration"]);
var redis = ConnectionMultiplexer.Connect(configuration["Redis:Configuration"]!);
dataProtectionBuilder.PersistKeysToStackExchangeRedis(redis, "MyProjectName-Protection-Keys");
}
}
@ -276,8 +276,7 @@ public class MyProjectNameBlazorModule : AbpModule
{
context.Services.AddSingleton<IDistributedLockProvider>(sp =>
{
var connection = ConnectionMultiplexer
.Connect(configuration["Redis:Configuration"]);
var connection = ConnectionMultiplexer.Connect(configuration["Redis:Configuration"]!);
return new RedisDistributedSynchronizationProvider(connection.GetDatabase());
});
}

@ -83,7 +83,7 @@ public class OpenIddictDataSeedContributor : IDataSeedContributor, ITransientDep
var webClientId = configurationSection["MyProjectName_Web:ClientId"];
if (!webClientId.IsNullOrWhiteSpace())
{
var webClientRootUrl = configurationSection["MyProjectName_Web:RootUrl"].EnsureEndsWith('/');
var webClientRootUrl = configurationSection["MyProjectName_Web:RootUrl"]!.EnsureEndsWith('/');
/* MyProjectName_Web client is only needed if you created a tiered
* solution. Otherwise, you can delete this client. */
@ -152,8 +152,7 @@ public class OpenIddictDataSeedContributor : IDataSeedContributor, ITransientDep
var blazorServerTieredClientId = configurationSection["MyProjectName_BlazorServerTiered:ClientId"];
if (!blazorServerTieredClientId.IsNullOrWhiteSpace())
{
var blazorServerTieredRootUrl =
configurationSection["MyProjectName_BlazorServerTiered:RootUrl"].EnsureEndsWith('/');
var blazorServerTieredRootUrl = configurationSection["MyProjectName_BlazorServerTiered:RootUrl"]!.EnsureEndsWith('/');
await CreateApplicationAsync(
name: blazorServerTieredClientId!,
@ -218,7 +217,7 @@ public class OpenIddictDataSeedContributor : IDataSeedContributor, ITransientDep
}
var client = await _openIddictApplicationRepository.FindByClientIdAsync(name);
var application = new AbpApplicationDescriptor {
ClientId = name,
Type = type,
@ -412,4 +411,4 @@ public class OpenIddictDataSeedContributor : IDataSeedContributor, ITransientDep
{
return existingClient.Permissions == JsonSerializer.Serialize(application.Permissions.Select(q => q.ToString().TrimEnd('/')));
}
}
}

@ -110,7 +110,7 @@ public class MyProjectNameHttpApiHostModule : AbpModule
private static void ConfigureSwaggerServices(ServiceConfigurationContext context, IConfiguration configuration)
{
context.Services.AddAbpSwaggerGenWithOAuth(
configuration["AuthServer:Authority"],
configuration["AuthServer:Authority"]!,
new Dictionary<string, string>
{
{"MyProjectName", "MyProjectName API"}
@ -131,7 +131,7 @@ public class MyProjectNameHttpApiHostModule : AbpModule
var dataProtectionBuilder = context.Services.AddDataProtection().SetApplicationName("MyProjectName");
if (!hostingEnvironment.IsDevelopment())
{
var redis = ConnectionMultiplexer.Connect(configuration["Redis:Configuration"]);
var redis = ConnectionMultiplexer.Connect(configuration["Redis:Configuration"]!);
dataProtectionBuilder.PersistKeysToStackExchangeRedis(redis, "MyProjectName-Protection-Keys");
}
}
@ -142,8 +142,7 @@ public class MyProjectNameHttpApiHostModule : AbpModule
{
context.Services.AddSingleton<IDistributedLockProvider>(sp =>
{
var connection = ConnectionMultiplexer
.Connect(configuration["Redis:Configuration"]);
var connection = ConnectionMultiplexer.Connect(configuration["Redis:Configuration"]!);
return new RedisDistributedSynchronizationProvider(connection.GetDatabase());
});
}

@ -137,7 +137,7 @@ public class MyProjectNameHttpApiHostModule : AbpModule
private static void ConfigureSwaggerServices(ServiceConfigurationContext context, IConfiguration configuration)
{
context.Services.AddAbpSwaggerGenWithOAuth(
configuration["AuthServer:Authority"],
configuration["AuthServer:Authority"]!,
new Dictionary<string, string>
{
{"MyProjectName", "MyProjectName API"}

@ -4,7 +4,7 @@ namespace MyCompanyName.MyProjectName.Models.Test;
public class TestModel
{
public string Name { get; set; }
public string? Name { get; set; }
public DateTime BirthDate { get; set; }
}

@ -229,7 +229,7 @@ public class MyProjectNameWebModule : AbpModule
var dataProtectionBuilder = context.Services.AddDataProtection().SetApplicationName("MyProjectName");
if (!hostingEnvironment.IsDevelopment())
{
var redis = ConnectionMultiplexer.Connect(configuration["Redis:Configuration"]);
var redis = ConnectionMultiplexer.Connect(configuration["Redis:Configuration"]!);
dataProtectionBuilder.PersistKeysToStackExchangeRedis(redis, "MyProjectName-Protection-Keys");
}
}
@ -240,8 +240,7 @@ public class MyProjectNameWebModule : AbpModule
{
context.Services.AddSingleton<IDistributedLockProvider>(sp =>
{
var connection = ConnectionMultiplexer
.Connect(configuration["Redis:Configuration"]);
var connection = ConnectionMultiplexer.Connect(configuration["Redis:Configuration"]!);
return new RedisDistributedSynchronizationProvider(connection.GetDatabase());
});
}

@ -165,7 +165,7 @@ public class MyProjectNameAuthServerModule : AbpModule
var dataProtectionBuilder = context.Services.AddDataProtection().SetApplicationName("MyProjectName");
if (!hostingEnvironment.IsDevelopment())
{
var redis = ConnectionMultiplexer.Connect(configuration["Redis:Configuration"]);
var redis = ConnectionMultiplexer.Connect(configuration["Redis:Configuration"]!);
dataProtectionBuilder.PersistKeysToStackExchangeRedis(redis, "MyProjectName-Protection-Keys");
}

@ -81,7 +81,7 @@ public class OpenIddictDataSeedContributor : IDataSeedContributor, ITransientDep
var webClientId = configurationSection["MyProjectName_Web:ClientId"];
if (!webClientId.IsNullOrWhiteSpace())
{
var webClientRootUrl = configurationSection["MyProjectName_Web:RootUrl"].EnsureEndsWith('/');
var webClientRootUrl = configurationSection["MyProjectName_Web:RootUrl"]!.EnsureEndsWith('/');
/* MyProjectName_Web client is only needed if you created a tiered
* solution. Otherwise, you can delete this client. */

@ -81,7 +81,7 @@ public class MyProjectNameHttpApiHostModule : AbpModule
}
context.Services.AddAbpSwaggerGenWithOAuth(
configuration["AuthServer:Authority"],
configuration["AuthServer:Authority"]!,
new Dictionary<string, string>
{
{"MyProjectName", "MyProjectName API"}
@ -133,7 +133,7 @@ public class MyProjectNameHttpApiHostModule : AbpModule
var dataProtectionBuilder = context.Services.AddDataProtection().SetApplicationName("MyProjectName");
if (!hostingEnvironment.IsDevelopment())
{
var redis = ConnectionMultiplexer.Connect(configuration["Redis:Configuration"]);
var redis = ConnectionMultiplexer.Connect(configuration["Redis:Configuration"]!);
dataProtectionBuilder.PersistKeysToStackExchangeRedis(redis, "MyProjectName-Protection-Keys");
}

@ -37,7 +37,7 @@ public class MyProjectNameWebHostMenuContributor : IMenuContributor
context.Menu.Items.Add(new ApplicationMenuItem(
"Account.Manage",
l["MyAccount"],
$"{_configuration["AuthServer:Authority"].EnsureEndsWith('/')}Account/Manage",
$"{_configuration["AuthServer:Authority"]!.EnsureEndsWith('/')}Account/Manage",
icon: "fa fa-cog",
order: int.MaxValue - 1001,
null,

@ -219,7 +219,7 @@ public class MyProjectNameWebHostModule : AbpModule
var dataProtectionBuilder = context.Services.AddDataProtection().SetApplicationName("MyProjectName");
if (!hostingEnvironment.IsDevelopment())
{
var redis = ConnectionMultiplexer.Connect(configuration["Redis:Configuration"]);
var redis = ConnectionMultiplexer.Connect(configuration["Redis:Configuration"]!);
dataProtectionBuilder.PersistKeysToStackExchangeRedis(redis, "MyProjectName-Protection-Keys");
}
}

Loading…
Cancel
Save