read me and added ignore suport to controller.

This commit is contained in:
David Lebee 2021-02-02 12:34:18 -05:00
parent 5292dfde52
commit 7f4c00ab3a
3 changed files with 25 additions and 0 deletions

View File

@ -2,6 +2,7 @@
using Microsoft.AspNetCore.Mvc.Controllers; using Microsoft.AspNetCore.Mvc.Controllers;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using PoweredSoft.CQRS.Abstractions.Discovery; using PoweredSoft.CQRS.Abstractions.Discovery;
using PoweredSoft.CQRS.AspNetCore.Abstractions.Attributes;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Reflection; using System.Reflection;
@ -23,6 +24,10 @@ namespace PoweredSoft.CQRS.AspNetCore.Mvc
var queryDiscovery = this.serviceProvider.GetRequiredService<IQueryDiscovery>(); var queryDiscovery = this.serviceProvider.GetRequiredService<IQueryDiscovery>();
foreach (var f in queryDiscovery.GetQueries()) foreach (var f in queryDiscovery.GetQueries())
{ {
var ignoreAttribute = f.QueryType.GetCustomAttribute<QueryControllerIgnoreAttribute>();
if (ignoreAttribute != null)
continue;
var controllerType = typeof(QueryController<,>).MakeGenericType(f.QueryType, f.QueryResultType); var controllerType = typeof(QueryController<,>).MakeGenericType(f.QueryType, f.QueryResultType);
var controllerTypeInfo = controllerType.GetTypeInfo(); var controllerTypeInfo = controllerType.GetTypeInfo();
feature.Controllers.Add(controllerTypeInfo); feature.Controllers.Add(controllerTypeInfo);

View File

@ -13,6 +13,12 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PoweredSoft.CQRS.AspNetCore
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Demo", "Demo\Demo.csproj", "{F15B1E11-8D4C-489E-AFF7-AA144105FE46}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Demo", "Demo\Demo.csproj", "{F15B1E11-8D4C-489E-AFF7-AA144105FE46}"
EndProject EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{617BA357-1A1F-40C5-B19A-A65A960E6142}"
ProjectSection(SolutionItems) = preProject
LICENSE = LICENSE
README.md = README.md
EndProjectSection
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU

14
README.md Normal file
View File

@ -0,0 +1,14 @@
# CQRS
Our implementation of query and command responsability segregation (CQRS).
## Getting Started
> Install nuget package to your awesome project.
| Full Version | NuGet | NuGet Install |
| ---------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -----------------------------------------------------: |
| PoweredSoft.CQRS.Abstractions | <a href="https://www.nuget.org/packages/PoweredSoft.CQRS.Abstractions/" target="_blank">[![NuGet](https://img.shields.io/nuget/v/PoweredSoft.CQRS.Abstractions.svg?style=flat-square&label=nuget)](https://www.nuget.org/packages/PoweredSoft.CQRS.Asbtractions/)</a> | ```PM> Install-Package PoweredSoft.CQRS.Abstractions ``` |
| PoweredSoft.CQRS | <a href="https://www.nuget.org/packages/PoweredSoft.CQRS/" target="_blank">[![NuGet](https://img.shields.io/nuget/v/PoweredSoft.CQRS.svg?style=flat-square&label=nuget)](https://www.nuget.org/packages/PoweredSoft.CQRS/)</a> | ```PM> Install-Package PoweredSoft.CQRS ``` |
| PoweredSoft.CQRS.AspNetCore.Abstractions | <a href="https://www.nuget.org/packages/PoweredSoft.CQRS.AspNetCore.Abstractions/" target="_blank">[![NuGet](https://img.shields.io/nuget/v/PoweredSoft.CQRS.AspNetCore.Abstractions.svg?style=flat-square&label=nuget)](https://www.nuget.org/packages/PoweredSoft.CQRS.AspNetCore.Abstractions/)</a> | ```PM> Install-Package PoweredSoft.CQRS.AspNetCore.Abstractions ``` |
| PoweredSoft.CQRS.AspNetCore | <a href="https://www.nuget.org/packages/PoweredSoft.CQRS.AspNetCore/" target="_blank">[![NuGet](https://img.shields.io/nuget/v/PoweredSoft.CQRS.AspNetCore.svg?style=flat-square&label=nuget)](https://www.nuget.org/packages/PoweredSoft.CQRS.AspNetCore/)</a> | ```PM> Install-Package PoweredSoft.CQRS.AspNetCore ``` |