// This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { IKernel ninjectKernel = new StandardKernel(new InterfacesRegistrationsBLL(Configuration.GetConnectionString("BookshelfDatabase"))); IUnitOfWorkService unitOfWorkService = ninjectKernel.Get <IUnitOfWorkService>(); UnitOfWorkExceptionMessageLocalization = ninjectKernel.Get <IUnitOfWorkExceptionMessageLocalization>(); services.AddScoped <IDataBaseService <AuthorDTO> >(o => new AuthorService(unitOfWorkService, UnitOfWorkExceptionMessageLocalization)); services.AddScoped <IDataBaseService <BookDTO> >(o => new BookService(unitOfWorkService, UnitOfWorkExceptionMessageLocalization)); services.AddScoped <IDataBaseService <GenreDTO> >(o => new GenreService(unitOfWorkService, UnitOfWorkExceptionMessageLocalization)); services.AddScoped <IDataBaseService <TagDTO> >(o => new TagService(unitOfWorkService, UnitOfWorkExceptionMessageLocalization)); services.AddScoped <IReportService>(o => new ReportService(unitOfWorkService, UnitOfWorkExceptionMessageLocalization)); services.AddScoped <IAccountService>(o => new AccountService(unitOfWorkService, UnitOfWorkExceptionMessageLocalization)); services.AddAutoMapper(); services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme) .AddJwtBearer(cfg => { cfg.RequireHttpsMetadata = false; cfg.SaveToken = true; cfg.TokenValidationParameters = new TokenValidationParameters() { ValidIssuer = "me", ValidAudience = "you", IssuerSigningKey = new SymmetricSecurityKey(Encoding.UTF8.GetBytes("rlyaKithdrYVl6Z80ODU350md")) //Secret }; }); services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1); BLLAutoMapperConfiguration.Configure(); services.AddSwaggerDocumentation(); }
protected override ICRUDDataBaseService <DriverLicenseGetDTO, DriverLicenseAddDTO, DriverLicenseUpdateDTO> CreateService (IUnitOfWorkService unitOfWorkService, IMapper mapper, IStringLocalizer <SharedResource> localizer, IUnitOfWorkValidator unitOfWorkValidator) { var service = new DriverLicenseService(unitOfWorkService, mapper, unitOfWorkValidator); service.Localizer = localizer; return(service); }
public MediaImporter(ILogger logger, IMediaFileSystemHelper fsHelper, IUnitOfWorkService unitOfWorkService) { this.Logger = logger; this.MediaFSHelper = fsHelper; this.UnitOfWorkService = unitOfWorkService; this.scanner = new MediaScanner(this.Logger, this.UnitOfWorkService, this.MediaFSHelper); this.monitor = new MediaMonitor(this.Logger, this.UnitOfWorkService, this.MediaFSHelper); }
protected override ICRUDDataBaseService <PositionGetUpdateDTO, PositionAddDTO, PositionGetUpdateDTO> CreateService (IUnitOfWorkService unitOfWorkService, IMapper mapper, IStringLocalizer <SharedResource> localizer, IUnitOfWorkValidator unitOfWorkValidator) { var service = new PositionService(unitOfWorkService, mapper, unitOfWorkValidator); service.Localizer = localizer; return(service); }
public AccountService(ICommandSender <Cqrs.Authentication.ISingleSignOnToken> commandSender, IUnitOfWorkService unitOfWorkService, IQueryFactory queryFactory, IAuthenticationTokenHelper <Cqrs.Authentication.ISingleSignOnToken> authenticationTokenHelper, ICorrelationIdHelper correlationIdHelper, ILogger logger) { CommandSender = commandSender; UnitOfWorkService = unitOfWorkService; QueryFactory = queryFactory; AuthenticationTokenHelper = authenticationTokenHelper; CorrelationIdHelper = correlationIdHelper; Logger = logger; }
public IndexModel( UserManager <UserCustom> userManager, SignInManager <UserCustom> signInManager, IUnitOfWorkService unitOfWork) { _userManager = userManager; _signInManager = signInManager; _unitOfWork = unitOfWork; }
public InventoryItemService(ICommandSender <Cqrs.Authentication.ISingleSignOnToken> commandSender, IUnitOfWorkService unitOfWorkService, IQueryFactory queryFactory, IAuthenticationTokenHelper <Cqrs.Authentication.ISingleSignOnToken> authenticationTokenHelper, ICorrolationIdHelper corrolationIdHelper, IInventoryItemRepository inventoryItemRepository) { CommandSender = commandSender; UnitOfWorkService = unitOfWorkService; QueryFactory = queryFactory; AuthenticationTokenHelper = authenticationTokenHelper; CorrolationIdHelper = corrolationIdHelper; InventoryItemRepository = inventoryItemRepository; }
public MediaController(IUnitOfWorkService unitOfWorkService, IMapper mapper, IMediaFileSystemController fsController, IThumbnailer thumbnailer) { this.UnitOfWorkService = unitOfWorkService; this.Mapper = mapper; this.FSController = fsController; this.Thumbnailer = thumbnailer; }
public PhoneRankingService( IUnitOfWorkService unitOfWorkService, ICacheService cacheService, IWebScraper webScraper ) { _cacheService = cacheService; _unitOfWorkService = unitOfWorkService; _webScraper = webScraper; }
public RegisterModel( UserManager <UserCustom> userManager, SignInManager <UserCustom> signInManager, ILogger <RegisterModel> logger, IUnitOfWorkService unitOfWork) { _userManager = userManager; _signInManager = signInManager; _logger = logger; _unitOfWork = unitOfWork; }
public OrderService(ICommandSender <Cqrs.Authentication.ISingleSignOnToken> commandSender, IUnitOfWorkService unitOfWorkService, IQueryFactory queryFactory, IAuthenticationTokenHelper <Cqrs.Authentication.ISingleSignOnToken> authenticationTokenHelper, ICorrelationIdHelper correlationIdHelper, IOrderRepository orderRepository, ILogger logger, IEventStore <Cqrs.Authentication.ISingleSignOnToken> eventStore) : base(eventStore, logger, correlationIdHelper, authenticationTokenHelper) { CommandSender = commandSender; UnitOfWorkService = unitOfWorkService; QueryFactory = queryFactory; AuthenticationTokenHelper = authenticationTokenHelper; CorrelationIdHelper = correlationIdHelper; OrderRepository = orderRepository; Logger = logger; }
/// <summary> /// Constructor /// </summary> internal LoadingServices(IDataSetup dataSetup, ICmObjectIdFactory objIdFactory, IFwMetaDataCacheManaged mdcManaged, ILgWritingSystemFactory wsf, IUnitOfWorkService uowService, ICmObjectSurrogateRepository surrRepository, ICmObjectRepository cmObjRepository) { m_dataSetup = dataSetup; m_objIdFactory = objIdFactory; m_mdcManaged = mdcManaged; m_wsf = wsf; m_uowService = uowService; m_surrRepository = surrRepository; m_cmObjRepository = cmObjRepository; }
public void ConfigureServices(IServiceCollection services) { var mappingConfig = new MapperConfiguration(cfg => { cfg.AddProfile <EmployeeToEmployeeDTOProfile>(); cfg.AddProfile <PositionToPositionDTOProfile>(); cfg.AddProfile <DriverCategoryToDriverCategoryDTOProfile>(); cfg.AddProfile <DriverLicensePhotoToDriverLicensePhotoDTOProfile>(); cfg.AddProfile <DriverLicenseToDriverLicenseDTOProfile>(); cfg.AddProfile <DriverMedicalCertificateToDriverMedicalCertificateDTOProfile>(); cfg.AddProfile <DriverMedicalCertificatePhotoToDriverMedicalCertificatePhotoDTOProfile>(); }); IMapper mapper = mappingConfig.CreateMapper(); services.AddSingleton(mapper); IKernel ninjectKernel = new StandardKernel(new InterfacesRegistrationsBLL(Configuration.GetConnectionString("LaborProtectionDatabase"))); IUnitOfWorkService unitOfWorkService = ninjectKernel.Get <IUnitOfWorkService>(); IUnitOfWorkValidator unitOfWorkValidator = ninjectKernel.Get <IUnitOfWorkValidator>(); services.AddScoped <ICRUDDataBaseService <EmployeeGetDTO, EmployeeAddDTO, EmployeeUpdateDTO> >(o => new EmployeeService(unitOfWorkService, mapper, unitOfWorkValidator)); services.AddScoped <ICRUDDataBaseService <PositionGetUpdateDTO, PositionAddDTO, PositionGetUpdateDTO> >(o => new PositionService(unitOfWorkService, mapper, unitOfWorkValidator)); services.AddScoped <ICRUDDataBaseService <DriverCategoryGetUpdateDTO, DriverCategoryAddDTO, DriverCategoryGetUpdateDTO> >(o => new DriverCategoryService(unitOfWorkService, mapper, unitOfWorkValidator)); services.AddScoped <ICRUDDataBaseService <DriverLicenseGetDTO, DriverLicenseAddDTO, DriverLicenseUpdateDTO> >(o => new DriverLicenseService(unitOfWorkService, mapper, unitOfWorkValidator)); services.AddScoped <ICRUDDataBaseService <DriverMedicalCertificateGetDTO, DriverMedicalCertificateAddDTO, DriverMedicalCertificateUpdateDTO> >(o => new DriverMedicalCertificateService(unitOfWorkService, mapper, unitOfWorkValidator)); services.AddScoped <ICRUDDataBaseService <DriverLicensePhotoGetDTO, DriverLicensePhotoAddDTO, DriverLicensePhotoUpdateDTO> >(o => new DriverLicensePhotoService(unitOfWorkService, mapper, unitOfWorkValidator)); services.AddScoped <ICRUDDataBaseService <DriverMedicalCertificatePhotoGetDTO, DriverMedicalCertificatePhotoAddDTO, DriverMedicalCertificatePhotoUpdateDTO> >(o => new DriverMedicalCertificatePhotoService(unitOfWorkService, mapper, unitOfWorkValidator)); services.AddScoped <IUploadDataFromFileService <XLWorkbook, ReadModelForExcel> >(o => new UploadDataFromExcelService(unitOfWorkService, mapper, unitOfWorkValidator)); services.AddLocalization(options => options.ResourcesPath = "Resources"); services.AddMvc() .AddDataAnnotationsLocalization(options => { options.DataAnnotationLocalizerProvider = (type, factory) => factory.Create(typeof(SharedResource)); }) .AddViewLocalization() .SetCompatibilityVersion(CompatibilityVersion.Version_2_2); services.Configure <RequestLocalizationOptions>(options => { var supportedCultures = new[] { new CultureInfo("en"), new CultureInfo("ru") }; options.DefaultRequestCulture = new RequestCulture("en"); options.SupportedCultures = supportedCultures; options.SupportedUICultures = supportedCultures; }); services.AddSwaggerDocumentation(); }
public TripController(IRepositoryTrip tripRepository, IRepositoryHistoryTrip historyRepository, ITripService tripService, IUtilService utilService, IUserService userService, IUnitOfWorkService unitOfWorkService, IWebHostEnvironment webHostEnvironment) { _repositoryTrip = tripRepository; _repositoryHistoryTrip = historyRepository; _tripService = tripService; _utilService = utilService; _userService = userService; _unitOfWorkService = unitOfWorkService; _webHostEnvironment = webHostEnvironment; }
public ContatoService(UnitOfWorkService uow) : base(uow) { _uow = uow; }
public EmployeeService(IUnitOfWorkService uow) { _uow = uow; }
public CreateAlbumsJob(ILogger logger, IUnitOfWorkService unitOfWorkService, IMediaFileSystemController fsController) : base(logger) { this.FSController = fsController; this.UnitOfWorkService = unitOfWorkService; }
public VerifyMediaJob(ILogger logger, IUnitOfWorkService unitOfWorkService, IMediaFileSystemHelper helper) : base(logger) { this.UnitOfWorkService = unitOfWorkService; this.MediaFSHelper = helper; }
/// <summary> /// /// </summary> public override void FixtureSetup() { base.FixtureSetup(); m_wordFormFactory = Cache.ServiceLocator.GetInstance<IWfiWordformFactory>(); var servLoc = Cache.ServiceLocator; NonUndoableUnitOfWorkHelper.Do(m_actionHandler, () => { Cache.LanguageProject.PeopleOA = servLoc.GetInstance<ICmPossibilityListFactory>().Create(); Cache.LanguageProject.PeopleOA.PossibilitiesOS.Add(servLoc.GetInstance<ICmPersonFactory>().Create()); // force Scripture reference system to be created - along with TranslatedScriptureOA Cache.LangProject.TranslatedScriptureOA = servLoc.GetInstance<IScriptureFactory>().Create(); }); m_uowService = Cache.ServiceLocator.GetInstance<IUnitOfWorkService>(); }
void VerifyChanges(ICmObject[] expectedNewbies, ICmObject[] expectedDirtballs, ICmObjectId[] expectedGoners, IUnitOfWorkService m_uowService) { var newbies = new HashSet<ICmObjectId>(); var dirtballs = new HashSet<ICmObjectOrSurrogate>(new ObjectSurrogateEquater()); var goners = new HashSet<ICmObjectId>(); m_uowService.GatherChanges(newbies, dirtballs, goners); var setNewbies = new HashSet<ICmObjectId>(from obj in expectedNewbies select obj.Id); Assert.That(newbies.Except(setNewbies), Is.Empty, "some unexpected newbies were found"); Assert.That(setNewbies.Except(newbies), Is.Empty, "some expected newbies were not found"); var setDirtballs = new HashSet<ICmObjectOrSurrogate>(expectedDirtballs.Cast<ICmObjectOrSurrogate>()); Assert.That(dirtballs.Except(setDirtballs), Is.Empty, "some unexpected dirtballs were found"); Assert.That(setDirtballs.Except(dirtballs), Is.Empty, "some expected dirtballs were not found"); var setGoners = new HashSet<ICmObjectId>(expectedGoners); Assert.That(goners.Except(setGoners), Is.Empty, "some unexpected goners were found"); Assert.That(setGoners.Except(goners), Is.Empty, "some expected goners were not found"); }
internal override void RegisterVirtualsModifiedForObjectDeletion(IUnitOfWorkService uow) { var cache = Cache; // need to make the Func use this local variable, because on Redo, Cache may return null. uow.RegisterVirtualCollectionAsModified(Cache.LangProject, Cache.ServiceLocator.GetInstance<Virtuals>().LangProjectAllWordforms, () => cache.ServiceLocator.GetInstance<IWfiWordformRepository>().AllInstances(), new IWfiWordform[0], new[] { this }); base.RegisterVirtualsModifiedForObjectDeletion(uow); }
public BookingsController(IUnitOfWorkService repo) : base(repo) { }
public UploadDataFromExcelService(IUnitOfWorkService unitOfWorkService, IMapper mapper, IUnitOfWorkValidator unitOfWorkValidator) : base(unitOfWorkService, mapper) { validator = unitOfWorkValidator.ValidatorExcelFile; validator.Localizer = Localizer; }
public ServiceBase(IUnitOfWorkService uow) { _uow = uow; }
public Time_zonesController(IUnitOfWorkService repo) : base(repo) { }
public UsersController(IUnitOfWorkService repo) : base(repo) { }
/// <summary> /// This registers LangProjTexts for undo/redo propchanges during creation /// so InterestingTexts.PropChanged gets called to add the text to the record list. /// </summary> /// <param name="uow"></param> internal override void RegisterVirtualsModifiedForObjectCreation(IUnitOfWorkService uow) { base.RegisterVirtualsModifiedForObjectCreation(uow); var cache = Cache; // need to make the Func use this local variable, because on Undo, Cache may return null. uow.RegisterVirtualCollectionAsModified(Cache.LangProject, Cache.ServiceLocator.GetInstance<Virtuals>().LangProjTexts, () => cache.ServiceLocator.GetInstance<ITextRepository>().AllInstances(), new[] { this }, new IText[0]); }
/// <summary> /// Constructor /// </summary> internal LoadingServices(IDataSetup dataSetup, ICmObjectIdFactory objIdFactory, IFwMetaDataCacheManaged mdcManaged, ILgWritingSystemFactory wsf, ITsStrFactory tsf, IUnitOfWorkService uowService, ICmObjectSurrogateRepository surrRepository, ICmObjectRepository cmObjRepository) { m_dataSetup = dataSetup; m_objIdFactory = objIdFactory; m_mdcManaged = mdcManaged; m_wsf = wsf; m_tsf = tsf; m_uowService = uowService; m_surrRepository = surrRepository; m_cmObjRepository = cmObjRepository; }
public UnitOfWorkApp(IUnitOfWorkService db) { _db = db; }
public CreateNewMediaJob(ILogger logger, IUnitOfWorkService unitOfWorkService, IMediaFileSystemHelper fsHelper) : base(logger) { this.UnitOfWorkService = unitOfWorkService; this.MediaFSHelper = fsHelper; }
public StockService(IUnitOfWorkService uow) : base(uow) { _uow = uow; }
public AppServiceBase(IUnitOfWorkService uow) { _uow = uow; _serviceBase = _uow.Service <IDataServiceBase <TEntity> >(); }
public CategoryService(IUnitOfWorkService unitOfWorkService) { _unitOfWorkService = unitOfWorkService; }
public GenreService(IUnitOfWorkService unitOfWorkService, IUnitOfWorkExceptionMessageLocalization unitOfWorkExceptionMessageLocalization) { UnitOfWork = unitOfWorkService.GetIUnitOfWorkBookshelfContext(); UnitOfWorkExceptionMessage = unitOfWorkExceptionMessageLocalization; }
public ValuesController(IUnitOfWorkService repo) : base(repo) { }
public StudentsController(IUnitOfWorkService unitOfWorkService, LoggerService loggerService) { _unitOfWorkService = unitOfWorkService; _loggerService = loggerService; }