Beispiel #1
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IDatabaseInitializer databaseInitializer, IServiceProvider services)
        {
            ConfigureAuth(app, services);
            app.UseDefaultFiles();
            app.UseStaticFiles();
            app.UseCors(builder =>
                        // This will allow any request from any server.
                        builder
                        .AllowAnyHeader()
                        .AllowAnyMethod()
                        .AllowAnyOrigin());


            AutomapperConfiguration.Load();

            app.UseDeveloperExceptionPage();
            app.UseMvc();

            app.UseSwagger((httpRequest, swaggerDoc) =>
            {
                swaggerDoc.Host = httpRequest.Host.Value;
            });

            app.UseSwaggerUi(baseRoute: "swagger", swaggerUrl: "/swagger/v1/swagger.json");
            app.UseMvcWithDefaultRoute();

            //app.UseIdentity();
            // Recreate db's
            //databaseInitializer.Seed().GetAwaiter().GetResult();
        }
Beispiel #2
0
        public void Setup()
        {
            // Setup unit of work with fake data to all including repos that using in unit of work
            Mock <IOrganizationRepository>     organizationRepository     = new Mock <IOrganizationRepository>();
            Mock <IOrganizationTypeRepository> organizationTypeRepository = new Mock <IOrganizationTypeRepository>();

            organizationRepository.Setup(repo => repo.GetAll()).Returns(OrganizationsFakeItems);
            organizationTypeRepository.Setup(rep => rep.GetAll()).Returns(OrganizationTypeFakeItems);
            _mockUnitOfWork = new Mock <IUnitOfWork>();
            _mockUnitOfWork.Setup(r => r.OrganizationRepository).Returns(organizationRepository.Object);
            _mockUnitOfWork.Setup(r => r.OrganizationTypeRepository).Returns(organizationTypeRepository.Object);
            _organizationService = new OrganizationService(_mockUnitOfWork.Object);
            // Load mapping
            AutomapperConfiguration.Load();
        }
        public void Setup()
        {
            // Setup unit of work with fake data to all including repos that using in unit of work
            Mock <ICargoTypeCategoryRepository> cargoTypeCategoryRepo = new Mock <ICargoTypeCategoryRepository>();
            Mock <ICargoTypeRepository>         cargoTypeRepo         = new Mock <ICargoTypeRepository>();

            cargoTypeCategoryRepo.Setup(repo => repo.GetAll()).Returns(CargoTypeCategoryFakeItems);
            cargoTypeRepo.Setup(rep => rep.GetAll()).Returns(CargoTypesFakeItems);
            _mockUnitOfWork = new Mock <IUnitOfWork>();
            _mockUnitOfWork.Setup(r => r.CargoTypeCategories).Returns(cargoTypeCategoryRepo.Object);
            _mockUnitOfWork.Setup(r => r.CargoTypes).Returns(cargoTypeRepo.Object);
            _cargoService = new CargoService(_mockUnitOfWork.Object);
            // Load mapping
            AutomapperConfiguration.Load();
        }
 protected override void OnStartup(StartupEventArgs e)
 {
     base.OnStartup(e);
     AutomapperConfiguration.Load();
 }
Beispiel #5
0
 public void AddBindingParameters(ServiceDescription serviceDescription, ServiceHostBase serviceHostBase,
                                  Collection <ServiceEndpoint> endpoints, BindingParameterCollection bindingParameters)
 {
     AutomapperConfiguration.Load();
 }
 /// <summary>
 /// Default constructor
 /// </summary>
 /// <param name="transactionService"></param>
 public TransactionHub(ITransactionService transactionService)
 {
     _transactionService = transactionService;
     AutomapperConfiguration.Load();
 }
Beispiel #7
0
 /// <summary>
 /// Default constructor
 /// </summary>
 /// <param name="organizationService"></param>
 public OrganizationHub(IOrganizationService organizationService)
 {
     _organizationService = organizationService;
     AutomapperConfiguration.Load();
 }