コード例 #1
0
        public DingTalkNewsController(IHostingEnvironment hostingEnvironment, IUowProvider uowProvider)
        {
            _hostingEnvironment = hostingEnvironment;
            var config = new AppConfigurationServices().Configuration;

            _uowProvider = uowProvider;
        }
コード例 #2
0
        public FinancialStatementController(IHostingEnvironment hostingEnvironment, IUowProvider uowProvider)
        {
            _hostingEnvironment = hostingEnvironment;
            var config = new AppConfigurationServices().Configuration;

            _uowProvider = uowProvider;
        }
コード例 #3
0
        /// <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);
        }
コード例 #4
0
ファイル: ECBaseController.cs プロジェクト: haitongxuan/Xin2
        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"]
            };
        }
コード例 #5
0
        private string GetHubUrl()
        {
            AppConfigurationServices config = new AppConfigurationServices();

            return(config.Configuration.GetSection("ChatHubUrl").Value);
        }
コード例 #6
0
ファイル: EcBaseJob.cs プロジェクト: haitongxuan/Xin2
        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"]
            };
        }
コード例 #7
0
 public MenuController(MysqlDataContext context, AppConfigurationServices config)
 {
     this.context = context;
     this.config  = config;
 }
コード例 #8
0
        public UsUiceNomalSkuQtyController(IUowProvider uowProvider)
        {
            var config = new AppConfigurationServices().Configuration;

            _uowProvider = uowProvider;
        }