Restructured query repositries to move ef logic from handlers

This commit is contained in:
2019-04-27 00:02:55 -04:00
parent 7be4075222
commit 1a95acac01
18 changed files with 169 additions and 59 deletions

View File

@@ -1,6 +1,7 @@
using BrightGlimmer.Data;
using BrightGlimmer.Data.Interfaces;
using BrightGlimmer.Data.Repositories;
using BrightGlimmer.Domain;
using MediatR;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
@@ -31,6 +32,8 @@ namespace BrightGlimmer.Api
services.AddTransient(typeof(IQueryRepository<>), typeof(QueryRepository<>));
services.AddTransient(typeof(ICommandRepository<>), typeof(CommandRepository<>));
services.AddTransient(typeof(IQueryRepository<Student>), typeof(StudentQueryRepository));
services.AddDbContext<BgContext>(options => options.UseSqlite(Configuration.GetConnectionString("DefaultConnection")));
services.AddTransient<BgContext, BgContext>();
}