You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
46 lines
1.5 KiB
46 lines
1.5 KiB
using Infrastructure.Data;
|
|
using Infrastructure.Email;
|
|
using Infrastructure.Sms;
|
|
using Infrastructure.Web;
|
|
using Microsoft.AspNetCore.Builder;
|
|
using Microsoft.AspNetCore.Hosting;
|
|
using Microsoft.Extensions.Configuration;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
using Microsoft.Extensions.Logging;
|
|
using Raven.Embedded;
|
|
using System;
|
|
|
|
namespace UserCenter
|
|
{
|
|
public class Startup : BaseStartup
|
|
{
|
|
public Startup(IConfiguration configuration, IWebHostEnvironment env) : base(configuration, env)
|
|
{
|
|
EmbeddedServer.Instance.StartServer();
|
|
}
|
|
|
|
public override void ConfigureServices(IServiceCollection services)
|
|
{
|
|
services.AddTransient<IDbConfig, DbConfig>();
|
|
services.AddTransient<IRoleService, RoleService>();
|
|
services.AddTransient<IEmailSender, EmptyEmailSender>();
|
|
services.AddTransient<ISmsSender, EmptySmsSender>();
|
|
//services.AddSingleton<FaceRecognitionService>();
|
|
base.ConfigureServices(services);
|
|
}
|
|
|
|
public override void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory loggerFactory)
|
|
{
|
|
base.Configure(app, env, loggerFactory);
|
|
//app.ApplicationServices.GetRequiredService<FaceRecognitionService>();
|
|
}
|
|
|
|
public override void CreateDatabase(IServiceProvider services)
|
|
{
|
|
//if (this.env.IsDevelopment())
|
|
{
|
|
base.CreateDatabase(services);
|
|
}
|
|
}
|
|
}
|
|
} |