public DingTalkNewsController(IHostingEnvironment hostingEnvironment, IUowProvider uowProvider) { _hostingEnvironment = hostingEnvironment; var config = new AppConfigurationServices().Configuration; _uowProvider = uowProvider; }
public FinancialStatementController(IHostingEnvironment hostingEnvironment, IUowProvider uowProvider) { _hostingEnvironment = hostingEnvironment; var config = new AppConfigurationServices().Configuration; _uowProvider = uowProvider; }
/// <summary> /// 这里将来改成单例 /// </summary> public static DbContext Create() { DbContext dbContext = Common.StaticTools.CallContext.GetData("DbContext") as DbContext; if (dbContext == null) { string connectionString = new AppConfigurationServices().GetConfiguration().GetConnectionString("BBSAdminConnection"); var optionsBuilder = new DbContextOptionsBuilder <Model.BBSAdmin.BBSAdminContext>() .UseMySql(connectionString)//,o=>o.UseRowNumberForPaging() .Options; dbContext = new Model.BBSAdmin.BBSAdminContext(optionsBuilder); Common.StaticTools.CallContext.SetData("DbContext", dbContext); } return(dbContext); }
public BaseController(IUowProvider uowProvider) { var config = new AppConfigurationServices().Configuration; _uowProvider = uowProvider; ecLogin = new EcLogin() { UserName = config["ECLogin:Username"], Password = config["ECLogin:Password"] }; omsApi = new OmsApiKey() { ApiKey = config["OmsApiKey:ApiKey"], ApiToken = config["OmsApiKey:ApiToken"] }; }
private string GetHubUrl() { AppConfigurationServices config = new AppConfigurationServices(); return(config.Configuration.GetSection("ChatHubUrl").Value); }
public EcBaseJob() { var logger = new Moq.Mock <ILogger <DataAccess> >(); var sp = new Moq.Mock <IServiceProvider>(); var myContext = new Service.Context.XinDBContext(new Microsoft.EntityFrameworkCore.DbContextOptions <Service.Context.XinDBContext>()); sp.Setup((o) => o.GetService(typeof(IEntityContext))).Returns(myContext); sp.Setup((o) => o.GetService(typeof(IRepository <ECDeliveryDetail>))) .Returns(new GenericEntityRepository <ECDeliveryDetail>(logger.Object)); sp.Setup((o) => o.GetService(typeof(IRepository <ECSalesOrder>))) .Returns(new GenericEntityRepository <ECSalesOrder>(logger.Object)); sp.Setup((o) => o.GetService(typeof(IRepository <ECSalesOrderAddress>))) .Returns(new GenericEntityRepository <ECSalesOrderAddress>(logger.Object)); sp.Setup((o) => o.GetService(typeof(IRepository <ECProduct>))) .Returns(new GenericEntityRepository <ECProduct>(logger.Object)); sp.Setup((o) => o.GetService(typeof(IRepository <ECReceivingDetail>))) .Returns(new GenericEntityRepository <ECReceivingDetail>(logger.Object)); sp.Setup((o) => o.GetService(typeof(IRepository <ECRMARefund>))) .Returns(new GenericEntityRepository <ECRMARefund>(logger.Object)); sp.Setup((o) => o.GetService(typeof(IRepository <ECSkuRelation>))) .Returns(new GenericEntityRepository <ECSkuRelation>(logger.Object)); sp.Setup((o) => o.GetService(typeof(IRepository <BnsSendDeliverdToEc>))) .Returns(new GenericEntityRepository <BnsSendDeliverdToEc>(logger.Object)); sp.Setup((o) => o.GetService(typeof(IRepository <ECRmaRefa>))) .Returns(new GenericEntityRepository <ECRmaRefa>(logger.Object)); sp.Setup((o) => o.GetService(typeof(IRepository <ECInventoryBatch>))) .Returns(new GenericEntityRepository <ECInventoryBatch>(logger.Object)); sp.Setup((o) => o.GetService(typeof(IRepository <ECTransitBatchNumber>))) .Returns(new GenericEntityRepository <ECTransitBatchNumber>(logger.Object)); sp.Setup((o) => o.GetService(typeof(IRepository <ECShipBatch>))) .Returns(new GenericEntityRepository <ECShipBatch>(logger.Object)); sp.Setup((o) => o.GetService(typeof(IRepository <ECWarehouse>))) .Returns(new GenericEntityRepository <ECWarehouse>(logger.Object)); sp.Setup((o) => o.GetService(typeof(IRepository <ECCurrency>))) .Returns(new GenericEntityRepository <ECCurrency>(logger.Object)); sp.Setup((o) => o.GetService(typeof(IRepository <ECShippingMethod>))) .Returns(new GenericEntityRepository <ECShippingMethod>(logger.Object)); _uowProvider = new UowProvider(logger.Object, sp.Object); var config = new AppConfigurationServices().Configuration; login = new LoginModel() { Username = config["ECLogin:Username"], Password = config["ECLogin:Password"] }; }
public MenuController(MysqlDataContext context, AppConfigurationServices config) { this.context = context; this.config = config; }
public UsUiceNomalSkuQtyController(IUowProvider uowProvider) { var config = new AppConfigurationServices().Configuration; _uowProvider = uowProvider; }