Added mongo db repository
This commit is contained in:
@@ -13,9 +13,9 @@ namespace BrightGlimmer.Api.Controllers
|
||||
public class StudentController : ControllerBase
|
||||
{
|
||||
// private readonly IMediator mediator;
|
||||
private readonly StudentRepository studentRepository;
|
||||
private readonly SqliteStudentRepository studentRepository;
|
||||
|
||||
public StudentController(StudentRepository studentRepository)
|
||||
public StudentController(SqliteStudentRepository studentRepository)
|
||||
{
|
||||
this.studentRepository = studentRepository;
|
||||
}
|
||||
|
||||
@@ -32,7 +32,8 @@ namespace BrightGlimmer.Api
|
||||
services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1);
|
||||
services.AddMediatR();
|
||||
services.AddMediatR(typeof(Cqrs.Cqrs).Assembly); // Registers handlers in Cqrs project
|
||||
services.AddScoped<StudentRepository, StudentRepository>(); /* REMOVE LATER */
|
||||
services.AddScoped<SqliteStudentRepository, SqliteStudentRepository>(); /* REMOVE LATER */
|
||||
services.AddScoped<MongoStudentRepository, MongoStudentRepository>(); /* REMOVE LATER */
|
||||
services.AddDbContext<SqliteDatabaseContext>(options => options.UseSqlite(Configuration.GetConnectionString("DefaultConnection")));
|
||||
services.AddTransient<SqliteDatabaseContext>();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user