public Models.Task Get(int id) { using (var db = new TicketingContext()) { return(db.Tasks.Where(x => x.IDTask == id).FirstOrDefault()); } }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env, TicketingContext concertContext) { _logger.LogInformation("Startup - Configuring app..."); if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } else { // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. app.UseHsts(); } // Seed DB //concertContext.DataSeed(); // Configure API app.UseMiddleware <ScopedLoggingMiddleware>(); app.UseAuthentication(); app.UseHttpsRedirection(); // prefer the middleware approach //app.UseExceptionHandlerWithProblemJson(); app.UseMiddleware <ExceptionHandlingMiddleware>(); //app.UseStatusCodePagesWithReExecute("/errors/{0}"); app.UseMvc(); app.UseOpenApi(); // Configure Automapper AutoMapperConfig.Initialize(); }
public IEnumerable <Models.Task> Get() { using (var db = new TicketingContext()) { return(db.Tasks); } }
public void Delete(int id) { Models.Task task = new Models.Task() { IDTask = id }; using (var db = new TicketingContext()) { db.Tasks.Attach(task); db.Tasks.Remove(task); db.SaveChanges(); } }
public Startup(IHostingEnvironment env) { var builder = new ConfigurationBuilder() .SetBasePath(env.ContentRootPath) .AddJsonFile("appsettings.json", optional: false, reloadOnChange: true) .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true) .AddEnvironmentVariables(); Configuration = builder.Build(); using (var client = new TicketingContext()) { client.Database.EnsureCreated(); } }
public VenueRepository(TicketingContext context) { _context = context; }
public TicketPurchasesController(TicketingContext context) { _context = context; }
public EventController(TicketingContext context) { _context = context; }
public RowController(TicketingContext context) { _context = context; }
public VenueController(TicketingContext context) { _context = context; }
public SeatingRepository(TicketingContext context) { _context = context; }
public EventSeatRepository(TicketingContext context) { _context = context; }
public SeatsController(TicketingContext context) { _context = context; }
public TicketPurchaseRepository(TicketingContext context) { _context = context; }
public TicketRepository(TicketingContext context) { _context = context; }
public CustomerRepository(TicketingContext context) { _context = context; }
public UsersRepository(TicketingContext context) { _context = context; _context.ChangeTracker.QueryTrackingBehavior = QueryTrackingBehavior.NoTracking; }
public SectionsController(TicketingContext context) { _context = context; }
public SectionRepository(TicketingContext context) { _context = context; }