Refactored repositories and fixed service injections

This commit is contained in:
2019-04-23 22:52:58 +00:00
parent a437573af0
commit f9badf98f4
15 changed files with 80 additions and 78 deletions

View File

@@ -5,7 +5,7 @@
</PropertyGroup>
<ItemGroup>
<Folder Include="Domain\Interfaces\" />
<Folder Include="Interfaces\" />
<Folder Include="Handlers\CommandHandlers\" />
<Folder Include="Commands\" />
<Folder Include="Handlers\QueryHandlers\" />

View File

@@ -4,5 +4,6 @@ using System.Text;
namespace BrightGlimmer.Cqrs
{
/* USED TO GET ASSEMBLY IN STARTUP.CS */
public class Cqrs { }
}

View File

@@ -3,10 +3,7 @@ using BrightGlimmer.Domain;
using BrightGlimmer.Services.Queries;
using MediatR;
using Microsoft.EntityFrameworkCore; /* TODO */
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
@@ -14,9 +11,9 @@ namespace BrightGlimmer.Services.Handlers.QueryHandlers
{
public class GetAllStudentsQueryHandler : IRequestHandler<GetAllStudentsQuery, IEnumerable<Student>>
{
private readonly IRepository<Student> repository;
private readonly IQueryRepository<Student> repository;
public GetAllStudentsQueryHandler(IRepository<Student> repository)
public GetAllStudentsQueryHandler(IQueryRepository<Student> repository)
{
this.repository = repository;
}

View File

@@ -1,8 +1,6 @@
using BrightGlimmer.Domain;
using MediatR;
using System;
using System.Collections.Generic;
using System.Text;
namespace BrightGlimmer.Services.Queries
{