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