// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env)
        {
            app.UseForwardedHeaders(new ForwardedHeadersOptions
            {
                ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto
            });

            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();
            }

            app.UseHttpsRedirection();
            app.UseMvc();

            // We will just create the table on startup if it doesn't exist since this is a demo
            using (var serviceScope = app.ApplicationServices.CreateScope())
            {
                var dbContext = serviceScope.ServiceProvider.GetService <VotingDBContext>();
                VotingDBContext.CreateTablesIfNotExists(dbContext);
            }
        }
        public VoteDataController(VotingDBContext context)
        {
            _context = context;

            var validOptionStringBuilder = new StringBuilder();

            foreach (var validOption in _validOptions)
            {
                validOptionStringBuilder.Append(validOption + " ");
            }
            _validOptionsString = validOptionStringBuilder.ToString();
        }
Example #3
0
 public LogSignUpController(IConfiguration config, IJWTService jwtservice, VotingDBContext db)
 {
     _config     = config;
     _jwtService = jwtservice;
     _db         = db;
 }
 public VoteDataController(VotingDBContext context, ILogger <VoteDataController> logger)
 {
     this.logger  = logger;
     this.context = context;
 }
Example #5
0
 public Rank4AdminController(VotingDBContext context)
 {
     _context = context;
 }
Example #6
0
 public PersonController(VotingDBContext context)
 {
     _context = context;
 }
Example #7
0
 public PartyController(VotingDBContext context, IWebHostEnvironment hostEnvironment)
 {
     _context = context;
     this._hostEnvironment = hostEnvironment;
 }
Example #8
0
 public DivisionController(VotingDBContext context)
 {
     _context = context;
 }
Example #9
0
 public VoteDataController(VotingDBContext context)
 {
     _context = context;
 }
Example #10
0
 public JWTService(IConfiguration config, VotingDBContext db)
 {
     _config = config;
     _db     = db;
 }
Example #11
0
 public VoteCanController(VotingDBContext context)
 {
     _context = context;
 }
Example #12
0
 public DistrictController(VotingDBContext context)
 {
     _context = context;
 }