Fixed csproj and removed unused folders

This commit is contained in:
2019-04-23 22:58:22 +00:00
parent f9badf98f4
commit a51306af55
7 changed files with 7 additions and 19 deletions

View File

@@ -0,0 +1,23 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<Folder Include="Interfaces\" />
<Folder Include="Handlers\CommandHandlers\" />
<Folder Include="Commands\" />
<Folder Include="Handlers\QueryHandlers\" />
<Folder Include="Queries\" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="MediatR" Version="6.0.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\BrightGlimmer.Data\BrightGlimmer.Data.csproj" />
</ItemGroup>
</Project>

View File

@@ -0,0 +1,9 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace BrightGlimmer.Cqrs
{
/* USED TO GET ASSEMBLY IN STARTUP.CS */
public class Cqrs { }
}

View File

@@ -0,0 +1,26 @@
using BrightGlimmer.Data.Interfaces;
using BrightGlimmer.Domain;
using BrightGlimmer.Services.Queries;
using MediatR;
using Microsoft.EntityFrameworkCore; /* TODO */
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
namespace BrightGlimmer.Services.Handlers.QueryHandlers
{
public class GetAllStudentsQueryHandler : IRequestHandler<GetAllStudentsQuery, IEnumerable<Student>>
{
private readonly IQueryRepository<Student> repository;
public GetAllStudentsQueryHandler(IQueryRepository<Student> repository)
{
this.repository = repository;
}
public async Task<IEnumerable<Student>> Handle(GetAllStudentsQuery request, CancellationToken cancellationToken)
{
return await repository.Get().ToListAsync();
}
}
}

View File

@@ -0,0 +1,10 @@
using BrightGlimmer.Domain;
using MediatR;
using System.Collections.Generic;
namespace BrightGlimmer.Services.Queries
{
public class GetAllStudentsQuery : IRequest<IEnumerable<Student>>
{
}
}