Setup initial solution structure fo application
This commit is contained in:
@@ -9,8 +9,14 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="MediatR" Version="6.0.0" />
|
||||
<PackageReference Include="MediatR.Extensions.Microsoft.DependencyInjection" Version="6.0.1" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.App" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Razor.Design" Version="2.1.2" PrivateAssets="All" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\BrightGlimmer.CQRS\BrightGlimmer.Cqrs.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
28
BrightGlimmer.Api/Controllers/CourseController.cs
Normal file
28
BrightGlimmer.Api/Controllers/CourseController.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using BrightGlimmer.Cqrs.Queries;
|
||||
using MediatR;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace BrightGlimmer.Api.Controllers
|
||||
{
|
||||
[Route("api/[controller]")]
|
||||
[ApiController]
|
||||
public class CourseController : ControllerBase
|
||||
{
|
||||
private readonly IMediator mediator;
|
||||
|
||||
public CourseController(IMediator mediator)
|
||||
{
|
||||
this.mediator = mediator;
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
public ActionResult<string> Get()
|
||||
{
|
||||
return "";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,45 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace BrightGlimmer.Api.Controllers
|
||||
{
|
||||
[Route("api/[controller]")]
|
||||
[ApiController]
|
||||
public class ValuesController : ControllerBase
|
||||
{
|
||||
// GET api/values
|
||||
[HttpGet]
|
||||
public ActionResult<IEnumerable<string>> Get()
|
||||
{
|
||||
return new string[] { "value1", "value2" };
|
||||
}
|
||||
|
||||
// GET api/values/5
|
||||
[HttpGet("{id}")]
|
||||
public ActionResult<string> Get(int id)
|
||||
{
|
||||
return "value";
|
||||
}
|
||||
|
||||
// POST api/values
|
||||
[HttpPost]
|
||||
public void Post([FromBody] string value)
|
||||
{
|
||||
}
|
||||
|
||||
// PUT api/values/5
|
||||
[HttpPut("{id}")]
|
||||
public void Put(int id, [FromBody] string value)
|
||||
{
|
||||
}
|
||||
|
||||
// DELETE api/values/5
|
||||
[HttpDelete("{id}")]
|
||||
public void Delete(int id)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,8 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using BrightGlimmer.Data;
|
||||
using MediatR;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.AspNetCore.HttpsPolicy;
|
||||
@@ -26,6 +28,8 @@ namespace BrightGlimmer.Api
|
||||
public void ConfigureServices(IServiceCollection services)
|
||||
{
|
||||
services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1);
|
||||
services.AddMediatR();
|
||||
services.AddMediatR(typeof(Cqrs.Cqrs).Assembly); // Registers handlers in Cqrs project
|
||||
}
|
||||
|
||||
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
|
||||
@@ -44,4 +48,4 @@ namespace BrightGlimmer.Api
|
||||
app.UseMvc();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
23
BrightGlimmer.CQRS/BrightGlimmer.Cqrs.csproj
Normal file
23
BrightGlimmer.CQRS/BrightGlimmer.Cqrs.csproj
Normal file
@@ -0,0 +1,23 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="Domain\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>
|
||||
8
BrightGlimmer.CQRS/Cqrs.cs
Normal file
8
BrightGlimmer.CQRS/Cqrs.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace BrightGlimmer.Cqrs
|
||||
{
|
||||
public class Cqrs { }
|
||||
}
|
||||
12
BrightGlimmer.Data/BrightGlimmer.Data.csproj
Normal file
12
BrightGlimmer.Data/BrightGlimmer.Data.csproj
Normal file
@@ -0,0 +1,12 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="Domain\Interfaces\" />
|
||||
<Folder Include="Repositories\" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
12
BrightGlimmer.Services/BrightGlimmer.Services.csproj
Normal file
12
BrightGlimmer.Services/BrightGlimmer.Services.csproj
Normal file
@@ -0,0 +1,12 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="Dtos\" />
|
||||
<Folder Include="Clients\" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -5,6 +5,12 @@ VisualStudioVersion = 16.0.28803.156
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BrightGlimmer.Api", "BrightGlimmer.Api\BrightGlimmer.Api.csproj", "{3E910B69-E79C-4418-BD6B-7ABB72ECF463}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BrightGlimmer.Services", "BrightGlimmer.Services\BrightGlimmer.Services.csproj", "{AAB743E1-637F-45CF-A013-A1E612FF95C6}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BrightGlimmer.Data", "BrightGlimmer.Data\BrightGlimmer.Data.csproj", "{E14193BB-31C7-4E3B-81F0-A930B866EC5D}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BrightGlimmer.Cqrs", "BrightGlimmer.CQRS\BrightGlimmer.Cqrs.csproj", "{AA6A646D-C493-43DC-BBE4-FF253852D9BF}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
@@ -15,6 +21,18 @@ Global
|
||||
{3E910B69-E79C-4418-BD6B-7ABB72ECF463}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{3E910B69-E79C-4418-BD6B-7ABB72ECF463}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{3E910B69-E79C-4418-BD6B-7ABB72ECF463}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{AAB743E1-637F-45CF-A013-A1E612FF95C6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{AAB743E1-637F-45CF-A013-A1E612FF95C6}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{AAB743E1-637F-45CF-A013-A1E612FF95C6}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{AAB743E1-637F-45CF-A013-A1E612FF95C6}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{E14193BB-31C7-4E3B-81F0-A930B866EC5D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{E14193BB-31C7-4E3B-81F0-A930B866EC5D}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{E14193BB-31C7-4E3B-81F0-A930B866EC5D}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{E14193BB-31C7-4E3B-81F0-A930B866EC5D}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{AA6A646D-C493-43DC-BBE4-FF253852D9BF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{AA6A646D-C493-43DC-BBE4-FF253852D9BF}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{AA6A646D-C493-43DC-BBE4-FF253852D9BF}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{AA6A646D-C493-43DC-BBE4-FF253852D9BF}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
||||
Reference in New Issue
Block a user