public UserRepository(OppJarContext context) : base(context) { UserRoles = context.UserRoles; Roles = context.Roles; _passwordHasher = ResolverFactory.GetService <IPasswordHasher <User> >(); }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IWebHostEnvironment env, OppJarContext context) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } context.Database.Migrate(); app.AddLog(env); app.UseSerilogRequestLogging(); app.UseSwashbuckle(); app.UseJWTBearerToken(Configuration); app.UseRouting(); app.UseAuthentication(); app.UseAuthorization(); app.UseStaticFiles(); app.UseDirectoryBrowser(new DirectoryBrowserOptions { FileProvider = new PhysicalFileProvider( Path.Combine(Directory.GetCurrentDirectory(), "wwwroot", "assets")), RequestPath = "/assets" }); var origins = Configuration.GetValue <string>("Cors"); app.UseCors(builder => { builder.WithOrigins(origins.Split(",")); builder.AllowAnyHeader(); builder.AllowAnyMethod(); builder.AllowCredentials(); }); app.UseEndpoints(endpoints => { endpoints.MapControllers(); }); }
public UnitOfWork(OppJarContext context) { _context = context; }
public UnitOfWork(OppJarContext context, IHttpContextAccessor httpContextAccessor) : this(context) { HttpContext = httpContextAccessor.HttpContext; _repositories = new Dictionary <Type, object>(); }
public GenericRepository(OppJarContext context) : base(context) { }
public CommandHandlerBase(OppJarContext context, MongoFactory mongoFactory) { _context = context; _mongoFactory = mongoFactory; }
public Repository(OppJarContext context) { _context = context; }