// This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddDbContext <ApplicationMainDbContext>(options =>
                                                             options.UseSqlServer(Configuration.GetConnectionString("DefaultConnection")));

            services.AddIdentity <ApplicationUser, IdentityRole>()
            .AddEntityFrameworkStores <ApplicationMainDbContext>()
            .AddDefaultTokenProviders();

            services.Configure <CookiePolicyOptions>(options =>
            {
                // This lambda determines whether user consent for non-essential cookies is needed for a given request.
                options.CheckConsentNeeded    = context => true;
                options.MinimumSameSitePolicy = SameSiteMode.None;
            });


            //Dependencie Injection
            services.AddScoped(typeof(IRepository <>), typeof(Repository <>));

            services.AddTransient <IPatientService, PatientService>();

            AutoMapperBootStrapper.RegisterMappings();

            services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1);
        }
Exemplo n.º 2
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddDbContext <PharmixEntityContext>(options =>
                                                         options.UseSqlServer(Configuration.GetConnectionString("DefaultConnection")));

            services.AddIdentity <ApplicationUser, IdentityRole>()
            .AddEntityFrameworkStores <PharmixEntityContext>()
            .AddDefaultTokenProviders();

            // Add application services.
            services.AddTransient <IEmailSender, EmailSender>();
            services.AddTransient <IRepository, Repository>();
            services.AddTransient <ICustomerService, CustomerService>();
            services.AddTransient <IShiftService, ShiftService>();
            services.AddTransient <ICacheService, CacheService>();
            services.AddTransient <IAuditInfoService, AuditInfoService>();

            services.AddTransient <IUserService, UserService>();
            services.AddTransient <IModuleService, ModuleService>();
            services.AddTransient <IRolePermissionService, RolePermissionService>();
            services.AddTransient <ISiteService, SiteService>();
            services.AddTransient <ITrustService, TrustService>();
            services.AddTransient <IPermissionGroupService, PermissionGroupService>();
            services.AddTransient <ILookupService, LookupService>();

            services.AddTransient <IPatientService, PatientService>();
            services.AddTransient <ISchedulerService, SchedulerService>();
            services.AddTransient <ILoanService, LoanService>();
            services.AddTransient <IDocumentService, DocumentService>();
            services.AddTransient <IBankAccountService, BankAccountService>();
            services.AddTransient <IViewRenderService, ViewRenderService>();


            services.AddSession(opts =>
            {
                opts.IdleTimeout     = TimeSpan.FromMinutes(20);
                opts.Cookie.HttpOnly = true;
            });

            services.AddMemoryCache();

            services.AddMvc()
            .AddJsonOptions(options => options.SerializerSettings.ContractResolver = new DefaultContractResolver());;
            AutoMapperBootStrapper.RegisterMappings();
            services.AddSignalR();
        }
Exemplo n.º 3
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddDbContext <PharmixEntityContext>(options => options.UseSqlServer(Configuration.GetConnectionString("DefaultConnection")));

            services.AddIdentity <ApplicationUser, IdentityRole>().AddEntityFrameworkStores <PharmixEntityContext>().AddDefaultTokenProviders();

            // Add application services.
            services.AddTransient <IEmailSender, EmailSender>();
            services.AddTransient <IRepository, Repository>();

            services.AddTransient <ICustomerService, CustomerService>();
            services.AddTransient <IIsolatorService, IsolatorService>();
            services.AddTransient <IShiftService, ShiftService>();
            services.AddTransient <IProductionService, ProductionService>();
            services.AddTransient <IIntegrationOrderService, IntegrationOrderService>();
            services.AddTransient <ICacheService, CacheService>();
            services.AddTransient <IAuditInfoService, AuditInfoService>();

            services.AddTransient <IUserService, UserService>();
            services.AddTransient <IModuleService, ModuleService>();
            services.AddTransient <IRolePermissionService, RolePermissionService>();
            services.AddTransient <ISiteService, SiteService>();
            services.AddTransient <ITrustService, TrustService>();
            services.AddTransient <IPermissionGroupService, PermissionGroupService>();
            services.AddTransient <ILookupService, LookupService>();
            services.AddTransient <IUsedProdService, UsedProdService>();

            services.AddTransient <IPatientService, PatientService>();
            services.AddTransient <IBusinessService, BusinessService>();

            services.AddTransient <IPackagePlanService, PackagePlanService>();
            services.AddTransient <IBusiness_SubscriptionService, Business_SubscriptionService>();
            services.AddSingleton <IPaypalServices, PaypalServices>();
            services.Configure <ConfigAuthOptions>(Configuration);

            services.AddMemoryCache();

            services.AddMvc().AddJsonOptions(options => options.SerializerSettings.ContractResolver = new DefaultContractResolver());;
            AutoMapperBootStrapper.RegisterMappings();
            services.AddSignalR();
            services.AddSingleton(typeof(IUserIdProvider), typeof(CustomUserIdProvider));
        }