Beispiel #1
0
 public Models.Task Get(int id)
 {
     using (var db = new TicketingContext())
     {
         return(db.Tasks.Where(x => x.IDTask == id).FirstOrDefault());
     }
 }
Beispiel #2
0
        // 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();
        }
Beispiel #3
0
 public IEnumerable <Models.Task> Get()
 {
     using (var db = new TicketingContext())
     {
         return(db.Tasks);
     }
 }
Beispiel #4
0
        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();
            }
        }
Beispiel #5
0
        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;
 }
Beispiel #7
0
 public TicketPurchasesController(TicketingContext context)
 {
     _context = context;
 }
Beispiel #8
0
 public EventController(TicketingContext context)
 {
     _context = context;
 }
Beispiel #9
0
 public RowController(TicketingContext context)
 {
     _context = context;
 }
Beispiel #10
0
 public VenueController(TicketingContext context)
 {
     _context = context;
 }
Beispiel #11
0
 public SeatingRepository(TicketingContext context)
 {
     _context = context;
 }
 public EventSeatRepository(TicketingContext context)
 {
     _context = context;
 }
Beispiel #13
0
 public SeatsController(TicketingContext context)
 {
     _context = context;
 }
 public TicketPurchaseRepository(TicketingContext context)
 {
     _context = context;
 }
Beispiel #15
0
 public TicketRepository(TicketingContext context)
 {
     _context = context;
 }
Beispiel #16
0
 public CustomerRepository(TicketingContext context)
 {
     _context = context;
 }
Beispiel #17
0
 public UsersRepository(TicketingContext context)
 {
     _context = context;
     _context.ChangeTracker.QueryTrackingBehavior = QueryTrackingBehavior.NoTracking;
 }
Beispiel #18
0
 public SectionsController(TicketingContext context)
 {
     _context = context;
 }
Beispiel #19
0
 public SectionRepository(TicketingContext context)
 {
     _context = context;
 }