public void SetUp(IRegisterComponent registerComponent) { //registerComponent.RegisterType<IService<CatOperator>, Service<CatOperator> >(); //registerComponent.RegisterType<IControlService, ControlService>(); var RepoType = typeof(IRepositoryAsync<CatOperator>); Object[] Parms1 = new Object[] { RepoType }; registerComponent.RegisterTypeWithInjectionTypes<IControlService, ControlService>(Parms1, false); //LogService for Data Conroller var RepoTypelog = typeof(IRepositoryAsync<Log>); Object[] ParmsLog = new Object[] { RepoTypelog }; registerComponent.RegisterTypeWithInjectionTypes<ILogService, LogService>(ParmsLog, false); }
public void SetUp(IRegisterComponent registerComponent) { //regisre DbCFpntext cuz ef lib required //IDataContextAsync context = new Logqso.mvc.DataModel.LogControl.LogControlDB(); ////LogControlDB context = new Logqso.mvc.DataModel.LogControl.LogControlDB(); //var stuff = context.CatOperator.FirstOrDefault(c => c.CatOprName == "SINGLE-OP"); // not needed cuz no interface //registerComponent.RegisterType<IDataContextAsync, LogControlContext>(); #if false //not used in datamodel var contextType = typeof(LogControlContext); //registerComponent.RegisterInstance<IDataContextAsync>(context); Object[] Parms = new Object[] { contextType }; registerComponent.RegisterTypeWithInjectionTypes<IUnitOfWorkAsync, UnitOfWork>(Parms, false); #endif }
public void SetUp(IRegisterComponent registerComponent) { #if false var contextType = typeof(LogControlContext); //registerComponent.RegisterInstance<IDataContextAsync>(context); Object[] Parms = new Object[] { contextType }; registerComponent.RegisterTypeWithInjectionTypes<IUnitOfWorkAsync, UnitOfWork>(Parms, false); #endif }
public void SetUp(IRegisterComponent registerComponent) { #if true //registerComponent.RegisterType<IDataContextAsync, LogqsoDataContext>(); // registerComponent.RegisterType<IUnitOfWorkAsync, UnitOfWork>(); //registerComponent.RegisterType<IRepositoryAsync<CatOperator>, Repository<CatOperator>>(); registerComponent.RegisterType<ILogqsoControlContext, ContestqsoContext>(); registerComponent.RegisterType<IControlUnitOfWorkAsync, ControlUnitOfWork>(); registerComponent.RegisterType<IRepositoryAsync<CatOperator>, ResposituryControl<CatOperator>>(); #else //regisre DbCFpntext cuz ef lib required //LogControlDB context = new Logqso.mvc.DataModel.LogControl.LogControlDB(); var contextType = typeof(LogControlContext); //registerComponent.RegisterInstance<LogControlDB>(context); #if true //MOVED FROM UI LATER //var contextType = typeof(LogControlContext); //registerComponent.RegisterInstance<IDataContextAsync>(context); Object[] Parms = new Object[] { contextType }; registerComponent.RegisterTypeWithInjectionTypes<IUnitOfWorkAsync, UnitOfWork>(Parms, false); #endif var uowType = typeof(IUnitOfWorkAsync); registerComponent.RegisterType<IDataContextAsync, LogControlContext>(); Object[] Parms2 = new Object[] { contextType, uowType }; registerComponent.RegisterTypeWithInjectionTypes<IRepositoryAsync<CatOperator>, Repository<CatOperator>>(Parms2, false); #endif //LOGQSOSATA #if true //registerComponent.RegisterType<IDataContextAsync, LogqsoDataContext>(); //registerComponent.RegisterType<IUnitOfWorkAsync, UnitOfWork>(); //registerComponent.RegisterType<IRepositoryAsync<Log>, Repository<Log>>(); //support for multiple DB registerComponent.RegisterType<ILogqsoDataContext, ContestqsoDataContext>(); registerComponent.RegisterType<ILogUnitOfWorkAsync, LogUnitOfWork>(); registerComponent.RegisterType<IRepositoryAsync<Log>, ResposituryLog<Log>>(); #else var contextTypeData = typeof(LogqsoDataContext); //registerComponent.RegisterType<IDataContextAsync, LogqsoDataContext>(); //contextTypeData = typeof(IDataContextAsync); Object[] ParmsData = new Object[] { contextTypeData }; registerComponent.RegisterTypeWithInjectionTypes<IUnitOfWorkDataAsync, UnitOfWorkData>(ParmsData, false); //registerComponent.RegisterTypeWithInjectionTypes<IUnitOfWorkAsync, UnitOfWork>(ParmsData, false); var uowTypeData = typeof(IUnitOfWorkDataAsync); Object[] ParmsData2 = new Object[] { contextTypeData, uowTypeData }; registerComponent.RegisterTypeWithInjectionTypes<IRepositoryAsync<Log>, Repository<Log>>(ParmsData2, false); #endif //IUnitOfWorkAsync UowObj = new UnitOfWork(context); //IRepositoryAsync<CatOperator> Repo = new Repository<CatOperator>(context, UowObj); //registerComponent.RegisterInstance<IRepositoryAsync<CatOperator>>(Repo); //var RepoType = typeof(IRepositoryAsync<CatOperator>); //Object[] Parms1 = new Object[] { // RepoType // }; //registerComponent.RegisterTypeWithInjectionTypes<IControlService, ControlService>(Parms1, false); }