public void ConfigureServices(IServiceCollection services) { services.AddControllers() .ConfigureApiBehaviorOptions(opt => opt.InvalidModelStateResponseFactory = actionContext => CustomModelValidationResponse(actionContext)) .AddJsonOptions(options => options.JsonSerializerOptions.PropertyNamingPolicy = SnakeCaseNamingPolicy.Instance); services.AddMvc(opt => { opt.UseGeneralRoutePrefix("api/v{version:apiVersion}"); var policy = new AuthorizationPolicyBuilder() .RequireAuthenticatedUser() .Build(); opt.Filters.Add(new AuthorizeFilter(policy)); }); var appSettingsSection = Configuration.GetSection(nameof(AppSettings)); services.Configure <AppSettings>(appSettingsSection); services.AddJwt(appSettingsSection); services.AddVersioningVibbra(); services.AddSwaggerVibbra(); services.AddResponseCompression(); services.AddDbContext <VibbraContext>(options => { VibbraContext.Configurar(options, Configuration.GetConnectionString("Default"), WebHostEnvironmen.IsDevelopment()); }); services.AddRepositoriesAndServices(); }
public CategoryRepository(VibbraContext context) : base(context, context.Category) { }
public RepositoryBase(VibbraContext context, DbSet <T> set) { Context = context; Set = set; }
public TimeRepository(VibbraContext context) { _context = context; }
public ProjectRepository(VibbraContext context) { _context = context; }
public ConfigurationRepository(VibbraContext context) : base(context, context.Configuration) { }
public UserRepository(VibbraContext vibbraContext) { _vibbraContext = vibbraContext; }
public CustomerRepository(VibbraContext context) : base(context, context.Customer) { }
public ExpenseRepository(VibbraContext context) : base(context, context.Expense) { }