using Microsoft.Extensions.DependencyInjection; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using WIDESEA_Core.Seed; namespace WIDESEA_Core { /// /// Db 启动服务 /// public static class DbSetup { /// /// 添加数据库设置服务到依赖注入容器 /// /// 服务集合 /// 当services为null时抛出 /// /// 注册DBSeed和DBContext为Scoped生命周期服务 /// public static void AddDbSetup(this IServiceCollection services) { if (services == null) throw new ArgumentNullException(nameof(services)); services.AddScoped(); services.AddScoped(); } } }