Exemple #1
0
 public GenericRepository(PostApplicationContext context)
 {
     if (context == null)
     {
         return;
     }
     _context = context;
     _dbSet   = _context.Set <TEntity>();
 }
Exemple #2
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IWebHostEnvironment env, PostApplicationContext context)
        {
            app.UseCors("CorsPolicy");

            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            app.UseHttpsRedirection();

            app.UseRouting();

            app.UseAuthorization();

            app.UseEndpoints(endpoints =>
            {
                endpoints.MapControllers();
            });

            SeedData.SeedDatabase(context);
        }
Exemple #3
0
 public UnitOfWork(PostApplicationContext dbContext)
 {
     this.dbContext = dbContext;
 }
 public UserRepository(PostApplicationContext context) : base(context)
 {
     this.context = context;
 }