public static void PopulateData(this EmployeePlatformContext db) { _db = db; PopulateUser(); PopulateIdentificationTypes(); PopulateAreas(); PopulateEmployees(); }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IWebHostEnvironment env, EmployeePlatformContext db) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); db.PopulateData(); } app.UseExceptionHandler(builder => { builder.Run( async context => { context.Response.StatusCode = (int)HttpStatusCode.InternalServerError; context.Response.Headers.Add("Access-Control-Allow-Origin", "*"); var error = context.Features.Get <IExceptionHandlerFeature>(); if (error != null) { context.Response.AddApplicationError(error.Error.Message); await context.Response.WriteAsync(error.Error.Message).ConfigureAwait(false); } }); }); app.UseCors(options => options.AllowAnyHeader().AllowAnyMethod().AllowAnyOrigin()); app.UseAuthentication(); app.UseGraphQL <EmployeePlatformSchema>("/graphql"); app.UseGraphQLPlayground(new GraphQLPlaygroundOptions()); app.UseHttpsRedirection(); app.UseRouting(); app.UseAuthorization(); app.UseEndpoints(endpoints => { endpoints.MapControllers(); }); }
public AreaRepository(EmployeePlatformContext db) { _db = db; }
public PaginationRepository(EmployeePlatformContext db) { _db = db; }
public IdentificationTypeRepository(EmployeePlatformContext db) { _db = db; }