Fixed csproj and removed unused folders
This commit is contained in:
23
BrightGlimmer.Service/BrightGlimmer.Service.csproj
Normal file
23
BrightGlimmer.Service/BrightGlimmer.Service.csproj
Normal 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>
|
||||
9
BrightGlimmer.Service/Cqrs.cs
Normal file
9
BrightGlimmer.Service/Cqrs.cs
Normal 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 { }
|
||||
}
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
10
BrightGlimmer.Service/Queries/GetAllStudentsQuery.cs
Normal file
10
BrightGlimmer.Service/Queries/GetAllStudentsQuery.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
using BrightGlimmer.Domain;
|
||||
using MediatR;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace BrightGlimmer.Services.Queries
|
||||
{
|
||||
public class GetAllStudentsQuery : IRequest<IEnumerable<Student>>
|
||||
{
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user