Ejemplo n.º 1
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IWebHostEnvironment env, VotingSystemContext votingSystemContext)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
                app.UseSwagger();
                app.UseSwaggerUI(c => c.SwaggerEndpoint("/swagger/v1/swagger.json", "VotingSystem.WebApplication v1"));
                votingSystemContext.Database.EnsureCreated(); // generate database at first time load of application
            }

            app.UseHttpsRedirection();

            app.UseRouting();

            app.UseAuthorization();

            app.UseEndpoints(endpoints =>
            {
                endpoints.MapControllers();
            });
        }
Ejemplo n.º 2
0
 public CandidateRepository(VotingSystemContext votingSystemContext) : base(votingSystemContext)
 {
     this._votingSystemContext = votingSystemContext;
 }
 public UnitOfWork(DbContext context)
 {
     _context = context;
 }
Ejemplo n.º 4
0
 public Repository(VotingSystemContext dbContext)
 {
     _dbContext = dbContext;
 }
Ejemplo n.º 5
0
 public VoterRepository(VotingSystemContext votingSystemContext) : base(votingSystemContext)
 {
     this._votingSystemContext = votingSystemContext;
 }