| | |
| | | /*********************************************************************** |
| | | * Project: CoreCms.Net * |
| | | * Web: https://CoreCms.Net * |
| | | * Project: baifenBinfa.Net * |
| | | * Web: https://baifenBinfa.com * |
| | | * ProjectName: 百分兵法管理系统 * |
| | | * Author: * |
| | | * Email: * |
| | |
| | | |
| | | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using CoreCms.Net.Caching.SqlSugar; |
| | | using CoreCms.Net.Configuration; |
| | | using CoreCms.Net.Loging; |
| | |
| | | if (services == null) throw new ArgumentNullException(nameof(services)); |
| | | |
| | | //注入 ORM |
| | | SugarIocServices.AddSqlSugar(new IocConfig() |
| | | //SugarIocServices.AddSqlSugar(new IocConfig() |
| | | //{ |
| | | // //数据库连接 |
| | | // ConnectionString = AppSettingsConstVars.DbSqlConnection, |
| | | // //判断数据库类型 |
| | | // DbType = AppSettingsConstVars.DbDbType == IocDbType.MySql.ToString() ? IocDbType.MySql : IocDbType.SqlServer, |
| | | // //是否开启自动关闭数据库连接 |
| | | // IsAutoCloseConnection = true |
| | | //}); |
| | | SugarIocServices.AddSqlSugar(new List<IocConfig> |
| | | { |
| | | //数据库连接 |
| | | new IocConfig{//数据库连接 |
| | | ConnectionString = AppSettingsConstVars.DbSqlConnection, |
| | | //判断数据库类型 |
| | | DbType = AppSettingsConstVars.DbDbType == IocDbType.MySql.ToString() ? IocDbType.MySql : IocDbType.SqlServer, |
| | | //是否开启自动关闭数据库连接 |
| | | IsAutoCloseConnection = true |
| | | }); |
| | | }, |
| | | new IocConfig |
| | | { |
| | | ConfigId=AppSettingsConstVars.CYDbDbID, |
| | | ConnectionString=AppSettingsConstVars.CyDbSqlConnection, |
| | | DbType = AppSettingsConstVars.CyDbDbType == IocDbType.MySql.ToString() ? IocDbType.MySql : IocDbType.SqlServer, |
| | | //是否开启自动关闭数据库连接 |
| | | IsAutoCloseConnection = true |
| | | } |
| | | |
| | | }); |
| | | //设置参数 |
| | | services.ConfigurationSugar(db => |
| | | { |