Browse Source
Use `NullEmailSender` in module template project.
pull/10542/head
maliming
4 years ago
No known key found for this signature in database
GPG Key ID: 96224957E51C89E
3 changed files with
18 additions and
0 deletions
-
templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Blazor.Server.Host/MyProjectNameBlazorHostModule.cs
-
templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/MyProjectNameIdentityServerModule.cs
-
templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Unified/MyProjectNameWebUnifiedModule.cs
|
|
|
@ -5,6 +5,7 @@ using Blazorise.Bootstrap5; |
|
|
|
using Blazorise.Icons.FontAwesome; |
|
|
|
using Microsoft.AspNetCore.Builder; |
|
|
|
using Microsoft.Extensions.DependencyInjection; |
|
|
|
using Microsoft.Extensions.DependencyInjection.Extensions; |
|
|
|
using Microsoft.Extensions.Hosting; |
|
|
|
using Microsoft.OpenApi.Models; |
|
|
|
using MyCompanyName.MyProjectName.Blazor.Server.Host.Menus; |
|
|
|
@ -26,6 +27,7 @@ using Volo.Abp.AspNetCore.Serilog; |
|
|
|
using Volo.Abp.AuditLogging.EntityFrameworkCore; |
|
|
|
using Volo.Abp.Autofac; |
|
|
|
using Volo.Abp.Data; |
|
|
|
using Volo.Abp.Emailing; |
|
|
|
using Volo.Abp.EntityFrameworkCore; |
|
|
|
using Volo.Abp.FeatureManagement; |
|
|
|
using Volo.Abp.FeatureManagement.EntityFrameworkCore; |
|
|
|
@ -196,6 +198,10 @@ namespace MyCompanyName.MyProjectName.Blazor.Server.Host |
|
|
|
{ |
|
|
|
options.AppAssembly = typeof(MyProjectNameBlazorHostModule).Assembly; |
|
|
|
}); |
|
|
|
|
|
|
|
#if DEBUG
|
|
|
|
context.Services.Replace(ServiceDescriptor.Singleton<IEmailSender, NullEmailSender>()); |
|
|
|
#endif
|
|
|
|
} |
|
|
|
|
|
|
|
public override void OnApplicationInitialization(ApplicationInitializationContext context) |
|
|
|
|
|
|
|
@ -5,6 +5,7 @@ using Microsoft.AspNetCore.Cors; |
|
|
|
using Microsoft.AspNetCore.DataProtection; |
|
|
|
using Microsoft.AspNetCore.Hosting; |
|
|
|
using Microsoft.Extensions.DependencyInjection; |
|
|
|
using Microsoft.Extensions.DependencyInjection.Extensions; |
|
|
|
using Microsoft.Extensions.Hosting; |
|
|
|
using MyCompanyName.MyProjectName.MultiTenancy; |
|
|
|
using StackExchange.Redis; |
|
|
|
@ -25,6 +26,7 @@ using Volo.Abp.Autofac; |
|
|
|
using Volo.Abp.Caching; |
|
|
|
using Volo.Abp.Caching.StackExchangeRedis; |
|
|
|
using Volo.Abp.Data; |
|
|
|
using Volo.Abp.Emailing; |
|
|
|
using Volo.Abp.EntityFrameworkCore; |
|
|
|
using Volo.Abp.EntityFrameworkCore.SqlServer; |
|
|
|
using Volo.Abp.FeatureManagement; |
|
|
|
@ -179,6 +181,10 @@ namespace MyCompanyName.MyProjectName |
|
|
|
.AllowCredentials(); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
#if DEBUG
|
|
|
|
context.Services.Replace(ServiceDescriptor.Singleton<IEmailSender, NullEmailSender>()); |
|
|
|
#endif
|
|
|
|
} |
|
|
|
|
|
|
|
public override void OnApplicationInitialization(ApplicationInitializationContext context) |
|
|
|
|
|
|
|
@ -2,6 +2,7 @@ using System.IO; |
|
|
|
using System.Reflection; |
|
|
|
using Microsoft.AspNetCore.Builder; |
|
|
|
using Microsoft.Extensions.DependencyInjection; |
|
|
|
using Microsoft.Extensions.DependencyInjection.Extensions; |
|
|
|
using Microsoft.Extensions.Hosting; |
|
|
|
using MyCompanyName.MyProjectName.EntityFrameworkCore; |
|
|
|
using MyCompanyName.MyProjectName.MultiTenancy; |
|
|
|
@ -17,6 +18,7 @@ using Volo.Abp.AspNetCore.Serilog; |
|
|
|
using Volo.Abp.AuditLogging.EntityFrameworkCore; |
|
|
|
using Volo.Abp.Autofac; |
|
|
|
using Volo.Abp.Data; |
|
|
|
using Volo.Abp.Emailing; |
|
|
|
using Volo.Abp.EntityFrameworkCore; |
|
|
|
using Volo.Abp.EntityFrameworkCore.SqlServer; |
|
|
|
using Volo.Abp.FeatureManagement; |
|
|
|
@ -132,6 +134,10 @@ namespace MyCompanyName.MyProjectName |
|
|
|
{ |
|
|
|
options.IsEnabled = MultiTenancyConsts.IsEnabled; |
|
|
|
}); |
|
|
|
|
|
|
|
#if DEBUG
|
|
|
|
context.Services.Replace(ServiceDescriptor.Singleton<IEmailSender, NullEmailSender>()); |
|
|
|
#endif
|
|
|
|
} |
|
|
|
|
|
|
|
public override void OnApplicationInitialization(ApplicationInitializationContext context) |
|
|
|
|