17 Commits

Author SHA1 Message Date
mathias 7804f9ba09 fix symbols and pipeline
Publish NuGets / build (release) Successful in 24s
2024-12-22 13:47:30 -05:00
mathias b7b88bc258 added icon and readmy for nugets, added gitea pipeline, added AoT compatible for all projects that are not AspNetCore specific 2024-12-22 11:59:19 -05:00
mathias c6a28f352f update package icon for Dynamic Query AspNet 2024-11-13 11:14:53 -05:00
mathias edb84a792a fix random chars in project file 2024-09-03 04:31:32 -04:00
mathias e58b86c0fb fix DynamicQueryController removed Generic that shouldn't have been removed in the first place, causing run time issues with MakeGeneric 2024-09-02 21:28:27 -04:00
mathias c230d039f2 Update README.md 2024-08-25 12:42:54 -04:00
mathias 43bf6ebd6b Update README.md 2024-08-25 12:40:59 -04:00
Mathias Beaulieu-Duncan 2da25631bf update roadmap 2023-11-08 22:57:59 -05:00
Mathias Beaulieu-Duncan 5188785339 update roadmap 2023-11-08 22:57:29 -05:00
Mathias Beaulieu-Duncan d328782681 update roadmap 2023-11-08 22:56:22 -05:00
Mathias Beaulieu-Duncan 1a54c12114 Merge remote-tracking branch 'origin/main' 2023-11-08 22:54:36 -05:00
Mathias Beaulieu-Duncan 4598cfedb7 better documentation 2023-11-08 22:54:32 -05:00
singatias fba604ad65 Update and rename nuget-publish.yml to publish-nugets.yml 2023-11-04 16:58:06 -04:00
singatias 415bcca48b Update nuget-publish.yml 2023-11-04 16:54:42 -04:00
singatias f5da1a966f Update nuget-publish.yml 2023-11-04 16:46:13 -04:00
singatias 008fb21c8c Rename dotnet.yml to nuget-publish.yml 2023-11-04 16:46:02 -04:00
Mathias Beaulieu-Duncan ad0d84f00b update documentation 2023-11-04 16:45:41 -04:00
20 changed files with 313 additions and 94 deletions
Vendored
BIN
View File
Binary file not shown.
+38
View File
@@ -0,0 +1,38 @@
# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
name: Publish NuGets
on:
release:
types:
- published
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Extract Release Version
id: extract_version
run: echo "RELEASE_VERSION=${{ github.event.release.tag_name }}" >> $GITHUB_ENV
- name: Debug Release Version
run: echo "RELEASE_VERSION=${{ env.RELEASE_VERSION }}"
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.x
- name: Restore dependencies
run: dotnet restore
- name: Build and Pack NuGet Package
run: dotnet pack -c Release -o ./artifacts -p:Version=${{ env.RELEASE_VERSION }}
- name: Publish to NuGet.org
run: |
dotnet nuget push ./artifacts/*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }}
@@ -18,6 +18,9 @@ jobs:
- name: Extract Release Version - name: Extract Release Version
id: extract_version id: extract_version
run: echo "RELEASE_VERSION=${{ github.event.release.tag_name }}" >> $GITHUB_ENV run: echo "RELEASE_VERSION=${{ github.event.release.tag_name }}" >> $GITHUB_ENV
- name: Debug Release Version
run: echo "RELEASE_VERSION=${{ env.RELEASE_VERSION }}"
- name: Setup .NET - name: Setup .NET
uses: actions/setup-dotnet@v3 uses: actions/setup-dotnet@v3
@@ -28,10 +31,8 @@ jobs:
run: dotnet restore run: dotnet restore
- name: Build and Pack NuGet Package - name: Build and Pack NuGet Package
run: dotnet pack -c Release -o ./artifacts run: dotnet pack -c Release -o ./artifacts -p:Version=${{ env.RELEASE_VERSION }}
- name: Publish to NuGet.org - name: Publish to NuGet.org
run: | run: |
dotnet nuget push ./artifacts/*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }} dotnet nuget push ./artifacts/*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }}
env:
NUGET_VERSION: ${{ steps.extract_version.outputs.release_version }}
@@ -1,10 +1,28 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework> <TargetFramework>net8.0</TargetFramework>
<PackageIconUrl>https://avatars.githubusercontent.com/u/52874619?v=4</PackageIconUrl> <IsAotCompatible>true</IsAotCompatible>
<Authors>David Lebee, Mathias Beaulieu-Duncan</Authors> <Authors>David Lebee, Mathias Beaulieu-Duncan</Authors>
<LangVersion>default</LangVersion> <LangVersion>default</LangVersion>
<Company>Open Harbor</Company>
<PackageIcon>icon.png</PackageIcon>
<PackageReadmeFile>README.md</PackageReadmeFile>
<RepositoryUrl>https://git.openharbor.io/Open-Harbor/dotnet-cqrs</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<DebugType>portable</DebugType>
<DebugSymbols>true</DebugSymbols>
<IncludeSymbols>true</IncludeSymbols>
<IncludeSource>true</IncludeSource>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
</PropertyGroup> </PropertyGroup>
<ItemGroup>
<None Include="..\icon.png" Pack="true" PackagePath="" CopyToOutputDirectory="Always" />
<None Include="..\README.md" Pack="true" PackagePath="" CopyToOutputDirectory="Always" />
</ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.0-rc.1.23419.4" /> <PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.0-rc.1.23419.4" />
@@ -1,11 +1,12 @@
using Microsoft.Extensions.DependencyInjection; using System.Diagnostics.CodeAnalysis;
using Microsoft.Extensions.DependencyInjection;
using OpenHarbor.CQRS.Abstractions.Discovery; using OpenHarbor.CQRS.Abstractions.Discovery;
namespace OpenHarbor.CQRS.Abstractions; namespace OpenHarbor.CQRS.Abstractions;
public static class ServiceCollectionExtensions public static class ServiceCollectionExtensions
{ {
public static IServiceCollection AddQuery<TQuery, TQueryResult, TQueryHandler>(this IServiceCollection services) public static IServiceCollection AddQuery<TQuery, TQueryResult, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TQueryHandler>(this IServiceCollection services)
where TQuery : class where TQuery : class
where TQueryHandler : class, IQueryHandler<TQuery, TQueryResult> where TQueryHandler : class, IQueryHandler<TQuery, TQueryResult>
{ {
@@ -19,7 +20,7 @@ public static class ServiceCollectionExtensions
return services; return services;
} }
public static IServiceCollection AddCommand<TCommand, TCommandResult, TCommandHandler>(this IServiceCollection services) public static IServiceCollection AddCommand<TCommand, TCommandResult, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TCommandHandler>(this IServiceCollection services)
where TCommand : class where TCommand : class
where TCommandHandler : class, ICommandHandler<TCommand, TCommandResult> where TCommandHandler : class, ICommandHandler<TCommand, TCommandResult>
{ {
@@ -33,7 +34,7 @@ public static class ServiceCollectionExtensions
return services; return services;
} }
public static IServiceCollection AddCommand<TCommand, TCommandHandler>(this IServiceCollection services) public static IServiceCollection AddCommand<TCommand, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TCommandHandler>(this IServiceCollection services)
where TCommand : class where TCommand : class
where TCommandHandler : class, ICommandHandler<TCommand> where TCommandHandler : class, ICommandHandler<TCommand>
{ {
@@ -1,8 +1,26 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework> <TargetFramework>net8.0</TargetFramework>
<PackageIconUrl>https://avatars.githubusercontent.com/u/52874619?v=4</PackageIconUrl> <IsAotCompatible>true</IsAotCompatible>
<Authors>David Lebee, Mathias Beaulieu-Duncan</Authors> <IsAotCompatible>false</IsAotCompatible>
<LangVersion>default</LangVersion> <LangVersion>default</LangVersion>
<Company>Open Harbor</Company>
<PackageIcon>icon.png</PackageIcon>
<PackageReadmeFile>README.md</PackageReadmeFile>
<RepositoryUrl>https://git.openharbor.io/Open-Harbor/dotnet-cqrs</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<DebugType>portable</DebugType>
<DebugSymbols>true</DebugSymbols>
<IncludeSymbols>true</IncludeSymbols>
<IncludeSource>true</IncludeSource>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
</PropertyGroup> </PropertyGroup>
<ItemGroup>
<None Include="..\icon.png" Pack="true" PackagePath="" CopyToOutputDirectory="Always" />
<None Include="..\README.md" Pack="true" PackagePath="" CopyToOutputDirectory="Always" />
</ItemGroup>
</Project> </Project>
@@ -8,28 +8,22 @@ using OpenHarbor.CQRS.AspNetCore.Abstractions.Attributes;
namespace OpenHarbor.CQRS.AspNetCore.Mvc; namespace OpenHarbor.CQRS.AspNetCore.Mvc;
public class QueryControllerFeatureProvider : IApplicationFeatureProvider<ControllerFeature> public class QueryControllerFeatureProvider(ServiceProvider serviceProvider)
: IApplicationFeatureProvider<ControllerFeature>
{ {
private readonly ServiceProvider _serviceProvider; public void PopulateFeature(IEnumerable<ApplicationPart> parts, ControllerFeature feature)
public QueryControllerFeatureProvider(ServiceProvider serviceProvider)
{ {
_serviceProvider = serviceProvider; var queryDiscovery = serviceProvider.GetRequiredService<IQueryDiscovery>();
} foreach (var queryMeta in queryDiscovery.GetQueries())
public void PopulateFeature(IEnumerable<ApplicationPart> parts, ControllerFeature feature)
{
var queryDiscovery = this._serviceProvider.GetRequiredService<IQueryDiscovery>();
foreach (var f in queryDiscovery.GetQueries())
{ {
var ignoreAttribute = f.QueryType.GetCustomAttribute<QueryControllerIgnoreAttribute>(); var ignoreAttribute = queryMeta.QueryType.GetCustomAttribute<QueryControllerIgnoreAttribute>();
if (ignoreAttribute != null) if (ignoreAttribute != null)
continue; continue;
if (f.Category != "BasicQuery") if (queryMeta.Category != "BasicQuery")
continue; continue;
var controllerType = typeof(QueryController<,>).MakeGenericType(f.QueryType, f.QueryResultType); var controllerType = typeof(QueryController<,>).MakeGenericType(queryMeta.QueryType, queryMeta.QueryResultType);
var controllerTypeInfo = controllerType.GetTypeInfo(); var controllerTypeInfo = controllerType.GetTypeInfo();
feature.Controllers.Add(controllerTypeInfo); feature.Controllers.Add(controllerTypeInfo);
} }
@@ -2,11 +2,28 @@
<PropertyGroup> <PropertyGroup>
<TargetFramework>net8.0</TargetFramework> <TargetFramework>net8.0</TargetFramework>
<PackageIconUrl>https://avatars.githubusercontent.com/u/52874619?v=4</PackageIconUrl> <IsAotCompatible>false</IsAotCompatible>
<Authors>David Lebee, Mathias Beaulieu-Duncan</Authors> <Authors>David Lebee, Mathias Beaulieu-Duncan</Authors>
<IsAotCompatible>true</IsAotCompatible> <Company>Open Harbor</Company>
<PackageIcon>icon.png</PackageIcon>
<PackageReadmeFile>README.md</PackageReadmeFile>
<RepositoryUrl>https://git.openharbor.io/Open-Harbor/dotnet-cqrs</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<DebugType>portable</DebugType>
<DebugSymbols>true</DebugSymbols>
<IncludeSymbols>true</IncludeSymbols>
<IncludeSource>true</IncludeSource>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
</PropertyGroup> </PropertyGroup>
<ItemGroup>
<None Include="..\icon.png" Pack="true" PackagePath="" CopyToOutputDirectory="Always" />
<None Include="..\README.md" Pack="true" PackagePath="" CopyToOutputDirectory="Always" />
</ItemGroup>
<ItemGroup> <ItemGroup>
<FrameworkReference Include="Microsoft.AspNetCore.App" /> <FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup> </ItemGroup>
@@ -16,4 +33,8 @@
<ProjectReference Include="..\OpenHarbor.CQRS.AspNetCore.Abstractions\OpenHarbor.CQRS.AspNetCore.Abstractions.csproj" /> <ProjectReference Include="..\OpenHarbor.CQRS.AspNetCore.Abstractions\OpenHarbor.CQRS.AspNetCore.Abstractions.csproj" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.12.0" />
</ItemGroup>
</Project> </Project>
@@ -1,12 +1,29 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework> <TargetFrameworks>netstandard2.1;net8.0</TargetFrameworks>
<IsAotCompatible Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0'))">true</IsAotCompatible>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<PackageIconUrl>https://avatars.githubusercontent.com/u/52874619?v=4</PackageIconUrl>
<Authors>David Lebee, Mathias Beaulieu-Duncan</Authors>
<LangVersion>default</LangVersion> <LangVersion>default</LangVersion>
<Company>Open Harbor</Company>
<PackageIcon>icon.png</PackageIcon>
<PackageReadmeFile>README.md</PackageReadmeFile>
<RepositoryUrl>https://git.openharbor.io/Open-Harbor/dotnet-cqrs</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<DebugType>portable</DebugType>
<DebugSymbols>true</DebugSymbols>
<IncludeSymbols>true</IncludeSymbols>
<IncludeSource>true</IncludeSource>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
</PropertyGroup> </PropertyGroup>
<ItemGroup>
<None Include="..\icon.png" Pack="true" PackagePath="" CopyToOutputDirectory="Always" />
<None Include="..\README.md" Pack="true" PackagePath="" CopyToOutputDirectory="Always" />
</ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="PoweredSoft.DynamicQuery.Core" Version="3.0.1" /> <PackageReference Include="PoweredSoft.DynamicQuery.Core" Version="3.0.1" />
</ItemGroup> </ItemGroup>
@@ -8,7 +8,7 @@ using PoweredSoft.DynamicQuery.Core;
namespace OpenHarbor.CQRS.DynamicQuery.AspNetCore.Mvc; namespace OpenHarbor.CQRS.DynamicQuery.AspNetCore.Mvc;
[ApiController, Route("api/query/[controller]")] [ApiController, Route("api/query/[controller]")]
public class DynamicQueryController<TSource, TDestination> : Controller public class DynamicQueryController<TUnderlyingQuery, TSource, TDestination> : Controller
where TSource : class where TSource : class
where TDestination : class where TDestination : class
{ {
@@ -34,7 +34,7 @@ public class DynamicQueryController<TSource, TDestination> : Controller
} }
[ApiController, Route("api/query/[controller]")] [ApiController, Route("api/query/[controller]")]
public class DynamicQueryController<TSource, TDestination, TParams> : Controller public class DynamicQueryController<TUnderlyingQuery, TSource, TDestination, TParams> : Controller
where TSource : class where TSource : class
where TDestination : class where TDestination : class
where TParams : class where TParams : class
@@ -1,4 +1,5 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Reflection; using System.Reflection;
using Microsoft.AspNetCore.Mvc.ApplicationParts; using Microsoft.AspNetCore.Mvc.ApplicationParts;
using Microsoft.AspNetCore.Mvc.Controllers; using Microsoft.AspNetCore.Mvc.Controllers;
@@ -9,18 +10,43 @@ using OpenHarbor.CQRS.DynamicQuery.Discover;
namespace OpenHarbor.CQRS.DynamicQuery.AspNetCore.Mvc; namespace OpenHarbor.CQRS.DynamicQuery.AspNetCore.Mvc;
public class DynamicQueryControllerFeatureProvider : IApplicationFeatureProvider<ControllerFeature> public class DynamicQueryControllerFeatureProvider(ServiceProvider serviceProvider)
: IApplicationFeatureProvider<ControllerFeature>
{ {
private readonly ServiceProvider _serviceProvider;
/**
* public void PopulateFeature(IEnumerable<ApplicationPart> parts, ControllerFeature feature)
{
var queryDiscovery = this.serviceProvider.GetRequiredService<IQueryDiscovery>();
foreach (var f in queryDiscovery.GetQueries())
{
var ignoreAttribute = f.QueryType.GetCustomAttribute<QueryControllerIgnoreAttribute>();
if (ignoreAttribute != null)
continue;
public DynamicQueryControllerFeatureProvider(ServiceProvider serviceProvider) if (f.Category != "DynamicQuery")
{ continue;
_serviceProvider = serviceProvider;
}
if (f is DynamicQueryMeta dynamicQueryMeta)
{
if (dynamicQueryMeta.ParamsType == null)
{
var controllerType = typeof(DynamicQueryController<,,>).MakeGenericType(f.QueryType, dynamicQueryMeta.SourceType, dynamicQueryMeta.DestinationType);
var controllerTypeInfo = controllerType.GetTypeInfo();
feature.Controllers.Add(controllerTypeInfo);
}
else
{
var controllerType = typeof(DynamicQueryController<,,,>).MakeGenericType(f.QueryType, dynamicQueryMeta.SourceType, dynamicQueryMeta.DestinationType, dynamicQueryMeta.ParamsType);
var controllerTypeInfo = controllerType.GetTypeInfo();
feature.Controllers.Add(controllerTypeInfo);
}
}
}
*/
public void PopulateFeature(IEnumerable<ApplicationPart> parts, ControllerFeature feature) public void PopulateFeature(IEnumerable<ApplicationPart> parts, ControllerFeature feature)
{ {
var queryDiscovery = _serviceProvider.GetRequiredService<IQueryDiscovery>(); var queryDiscovery = serviceProvider.GetRequiredService<IQueryDiscovery>();
foreach (var queryMeta in queryDiscovery.GetQueries()) foreach (var queryMeta in queryDiscovery.GetQueries())
{ {
var ignoreAttribute = queryMeta.QueryType.GetCustomAttribute<QueryControllerIgnoreAttribute>(); var ignoreAttribute = queryMeta.QueryType.GetCustomAttribute<QueryControllerIgnoreAttribute>();
@@ -32,15 +58,19 @@ public class DynamicQueryControllerFeatureProvider : IApplicationFeatureProvider
if (queryMeta is DynamicQueryMeta dynamicQueryMeta) if (queryMeta is DynamicQueryMeta dynamicQueryMeta)
{ {
// todo: add better error output for the user
if (dynamicQueryMeta.ParamsType == null) if (dynamicQueryMeta.ParamsType == null)
{ {
var controllerType = typeof(DynamicQueryController<,>).MakeGenericType(queryMeta.QueryType, dynamicQueryMeta.SourceType, dynamicQueryMeta.DestinationType); // todo: not aot friendly
var controllerType = typeof(DynamicQueryController<,,>).MakeGenericType(queryMeta.QueryType, dynamicQueryMeta.SourceType, dynamicQueryMeta.DestinationType);
var controllerTypeInfo = controllerType.GetTypeInfo(); var controllerTypeInfo = controllerType.GetTypeInfo();
feature.Controllers.Add(controllerTypeInfo); feature.Controllers.Add(controllerTypeInfo);
} }
else else
{ {
var controllerType = typeof(DynamicQueryController<,,>).MakeGenericType(queryMeta.QueryType, dynamicQueryMeta.SourceType, dynamicQueryMeta.DestinationType, dynamicQueryMeta.ParamsType); // todo: not aot friendly
var controllerType = typeof(DynamicQueryController<,,,>).MakeGenericType(queryMeta.QueryType, dynamicQueryMeta.SourceType, dynamicQueryMeta.DestinationType, dynamicQueryMeta.ParamsType);
var controllerTypeInfo = controllerType.GetTypeInfo(); var controllerTypeInfo = controllerType.GetTypeInfo();
feature.Controllers.Add(controllerTypeInfo); feature.Controllers.Add(controllerTypeInfo);
} }
@@ -1,11 +1,27 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net8.0</TargetFramework> <TargetFramework>net8.0</TargetFramework>
<PackageIconUrl>https://avatars.githubusercontent.com/u/52874619?v=4</PackageIconUrl> <IsAotCompatible>false</IsAotCompatible>
<Authors>David Lebee, Mathias Beaulieu-Duncan</Authors> <Company>Open Harbor</Company>
<IsAotCompatible>true</IsAotCompatible> <PackageIcon>icon.png</PackageIcon>
<PackageReadmeFile>README.md</PackageReadmeFile>
<RepositoryUrl>https://git.openharbor.io/Open-Harbor/dotnet-cqrs</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<DebugType>portable</DebugType>
<DebugSymbols>true</DebugSymbols>
<IncludeSymbols>true</IncludeSymbols>
<IncludeSource>true</IncludeSource>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
</PropertyGroup> </PropertyGroup>
<ItemGroup>
<None Include="..\icon.png" Pack="true" PackagePath="" CopyToOutputDirectory="Always" />
<None Include="..\README.md" Pack="true" PackagePath="" CopyToOutputDirectory="Always" />
</ItemGroup>
<ItemGroup> <ItemGroup>
<FrameworkReference Include="Microsoft.AspNetCore.App" /> <FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup> </ItemGroup>
@@ -1,11 +1,28 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework> <TargetFramework>net8.0</TargetFramework>
<PackageIconUrl>https://avatars.githubusercontent.com/u/52874619?v=4</PackageIconUrl> <IsAotCompatible>true</IsAotCompatible>
<Authors>David Lebee, Mathias Beaulieu-Duncan</Authors>
<LangVersion>default</LangVersion> <LangVersion>default</LangVersion>
<Company>Open Harbor</Company>
<PackageIcon>icon.png</PackageIcon>
<PackageReadmeFile>README.md</PackageReadmeFile>
<RepositoryUrl>https://git.openharbor.io/Open-Harbor/dotnet-cqrs</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<DebugType>portable</DebugType>
<DebugSymbols>true</DebugSymbols>
<IncludeSymbols>true</IncludeSymbols>
<IncludeSource>true</IncludeSource>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
</PropertyGroup> </PropertyGroup>
<ItemGroup>
<None Include="..\icon.png" Pack="true" PackagePath="" CopyToOutputDirectory="Always" />
<None Include="..\README.md" Pack="true" PackagePath="" CopyToOutputDirectory="Always" />
</ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Pluralize.NET" Version="1.0.2" /> <PackageReference Include="Pluralize.NET" Version="1.0.2" />
<PackageReference Include="PoweredSoft.DynamicQuery" Version="3.0.1" /> <PackageReference Include="PoweredSoft.DynamicQuery" Version="3.0.1" />
@@ -1,4 +1,5 @@
using Microsoft.Extensions.DependencyInjection; using System.Diagnostics.CodeAnalysis;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions; using Microsoft.Extensions.DependencyInjection.Extensions;
using OpenHarbor.CQRS.Abstractions; using OpenHarbor.CQRS.Abstractions;
using OpenHarbor.CQRS.Abstractions.Discovery; using OpenHarbor.CQRS.Abstractions.Discovery;
@@ -35,7 +36,7 @@ public static class ServiceCollectionExtensions
return services; return services;
} }
public static IServiceCollection AddDynamicQueryWithProvider<TSource, TQueryableProvider>(this IServiceCollection services, string name = null) public static IServiceCollection AddDynamicQueryWithProvider<TSource, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TQueryableProvider>(this IServiceCollection services, string name = null)
where TQueryableProvider : class, IQueryableProvider<TSource> where TQueryableProvider : class, IQueryableProvider<TSource>
where TSource : class where TSource : class
{ {
@@ -44,7 +45,7 @@ public static class ServiceCollectionExtensions
return services; return services;
} }
public static IServiceCollection AddDynamicQueryWithParamsAndProvider<TSource, TParams, TQueryableProvider>(this IServiceCollection services, string name = null) public static IServiceCollection AddDynamicQueryWithParamsAndProvider<TSource, TParams, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TQueryableProvider>(this IServiceCollection services, string name = null)
where TQueryableProvider : class, IQueryableProvider<TSource> where TQueryableProvider : class, IQueryableProvider<TSource>
where TParams : class where TParams : class
where TSource : class where TSource : class
@@ -84,19 +85,19 @@ public static class ServiceCollectionExtensions
return services; return services;
} }
public static IServiceCollection AddAlterQueryable<TSourceAndDestination, TService>(this IServiceCollection services) public static IServiceCollection AddAlterQueryable<TSourceAndDestination, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TService>(this IServiceCollection services)
where TService : class, IAlterQueryableService<TSourceAndDestination, TSourceAndDestination> where TService : class, IAlterQueryableService<TSourceAndDestination, TSourceAndDestination>
{ {
return services.AddTransient<IAlterQueryableService<TSourceAndDestination, TSourceAndDestination>, TService>(); return services.AddTransient<IAlterQueryableService<TSourceAndDestination, TSourceAndDestination>, TService>();
} }
public static IServiceCollection AddAlterQueryable<TSource, TDestination, TService>(this IServiceCollection services) public static IServiceCollection AddAlterQueryable<TSource, TDestination, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TService>(this IServiceCollection services)
where TService : class, IAlterQueryableService<TSource, TDestination> where TService : class, IAlterQueryableService<TSource, TDestination>
{ {
return services.AddTransient<IAlterQueryableService<TSource, TDestination>, TService>(); return services.AddTransient<IAlterQueryableService<TSource, TDestination>, TService>();
} }
public static IServiceCollection AddAlterQueryableWithParams<TSourceAndTDestination, TParams, TService> public static IServiceCollection AddAlterQueryableWithParams<TSourceAndTDestination, TParams, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TService>
(this IServiceCollection services) (this IServiceCollection services)
where TParams : class where TParams : class
where TService : class, IAlterQueryableService<TSourceAndTDestination, TSourceAndTDestination, TParams> where TService : class, IAlterQueryableService<TSourceAndTDestination, TSourceAndTDestination, TParams>
@@ -104,7 +105,7 @@ public static class ServiceCollectionExtensions
return services.AddTransient<IAlterQueryableService< TSourceAndTDestination, TSourceAndTDestination, TParams>, TService>(); return services.AddTransient<IAlterQueryableService< TSourceAndTDestination, TSourceAndTDestination, TParams>, TService>();
} }
public static IServiceCollection AddAlterQueryableWithParams<TSource, TDestination, TParams, TService> public static IServiceCollection AddAlterQueryableWithParams<TSource, TDestination, TParams, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TService>
(this IServiceCollection services) (this IServiceCollection services)
where TParams : class where TParams : class
where TService : class, IAlterQueryableService<TSource, TDestination, TParams> where TService : class, IAlterQueryableService<TSource, TDestination, TParams>
@@ -112,7 +113,7 @@ public static class ServiceCollectionExtensions
return services.AddTransient<IAlterQueryableService<TSource, TDestination, TParams>, TService>(); return services.AddTransient<IAlterQueryableService<TSource, TDestination, TParams>, TService>();
} }
public static IServiceCollection AddDynamicQueryInterceptor<TSource, TDestination, TInterceptor>(this IServiceCollection services) public static IServiceCollection AddDynamicQueryInterceptor<TSource, TDestination, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TInterceptor>(this IServiceCollection services)
where TInterceptor : class, IQueryInterceptor where TInterceptor : class, IQueryInterceptor
{ {
services.TryAddTransient<TInterceptor>(); services.TryAddTransient<TInterceptor>();
@@ -120,7 +121,7 @@ public static class ServiceCollectionExtensions
new DynamicQueryInterceptorProvider<TSource, TDestination>(typeof(TInterceptor))); new DynamicQueryInterceptorProvider<TSource, TDestination>(typeof(TInterceptor)));
} }
public static IServiceCollection AddDynamicQueryInterceptors<TSource, TDestination, T1, T2>(this IServiceCollection services) public static IServiceCollection AddDynamicQueryInterceptors<TSource, TDestination, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] T1, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] T2>(this IServiceCollection services)
where T1 : class, IQueryInterceptor where T1 : class, IQueryInterceptor
where T2 : class, IQueryInterceptor where T2 : class, IQueryInterceptor
{ {
@@ -130,7 +131,7 @@ public static class ServiceCollectionExtensions
new DynamicQueryInterceptorProvider<TSource, TDestination>(typeof(T1), typeof(T2))); new DynamicQueryInterceptorProvider<TSource, TDestination>(typeof(T1), typeof(T2)));
} }
public static IServiceCollection AddDynamicQueryInterceptors<TSource, TDestination, T1, T2, T3>(this IServiceCollection services) public static IServiceCollection AddDynamicQueryInterceptors<TSource, TDestination, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] T1, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] T2, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] T3>(this IServiceCollection services)
where T1 : class, IQueryInterceptor where T1 : class, IQueryInterceptor
where T2 : class, IQueryInterceptor where T2 : class, IQueryInterceptor
where T3 : class, IQueryInterceptor where T3 : class, IQueryInterceptor
@@ -142,7 +143,7 @@ public static class ServiceCollectionExtensions
new DynamicQueryInterceptorProvider<TSource, TDestination>(typeof(T1), typeof(T2), typeof(T3))); new DynamicQueryInterceptorProvider<TSource, TDestination>(typeof(T1), typeof(T2), typeof(T3)));
} }
public static IServiceCollection AddDynamicQueryInterceptors<TSource, TDestination, T1, T2, T3, T4>(this IServiceCollection services) public static IServiceCollection AddDynamicQueryInterceptors<TSource, TDestination, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] T1, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] T2, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] T3, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] T4>(this IServiceCollection services)
where T1 : class, IQueryInterceptor where T1 : class, IQueryInterceptor
where T2 : class, IQueryInterceptor where T2 : class, IQueryInterceptor
where T3 : class, IQueryInterceptor where T3 : class, IQueryInterceptor
@@ -156,7 +157,7 @@ public static class ServiceCollectionExtensions
new DynamicQueryInterceptorProvider<TSource, TDestination>(typeof(T1), typeof(T2), typeof(T3), typeof(T4))); new DynamicQueryInterceptorProvider<TSource, TDestination>(typeof(T1), typeof(T2), typeof(T3), typeof(T4)));
} }
public static IServiceCollection AddDynamicQueryInterceptors<TSource, TDestination, T1, T2, T3, T4, T5>(this IServiceCollection services) public static IServiceCollection AddDynamicQueryInterceptors<TSource, TDestination, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] T1, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] T2, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] T3, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] T4, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] T5>(this IServiceCollection services)
where T1 : class, IQueryInterceptor where T1 : class, IQueryInterceptor
where T2 : class, IQueryInterceptor where T2 : class, IQueryInterceptor
where T3 : class, IQueryInterceptor where T3 : class, IQueryInterceptor
@@ -1,11 +1,28 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework> <TargetFramework>net8.0</TargetFramework>
<PackageIconUrl>https://avatars.githubusercontent.com/u/52874619?v=4</PackageIconUrl> <IsAotCompatible>true</IsAotCompatible>
<Authors>David Lebee, Mathias Beaulieu-Duncan</Authors>
<LangVersion>default</LangVersion> <LangVersion>default</LangVersion>
<Company>Open Harbor</Company>
<PackageIcon>icon.png</PackageIcon>
<PackageReadmeFile>README.md</PackageReadmeFile>
<RepositoryUrl>https://git.openharbor.io/Open-Harbor/dotnet-cqrs</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<DebugType>portable</DebugType>
<DebugSymbols>true</DebugSymbols>
<IncludeSymbols>true</IncludeSymbols>
<IncludeSource>true</IncludeSource>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
</PropertyGroup> </PropertyGroup>
<ItemGroup>
<None Include="..\icon.png" Pack="true" PackagePath="" CopyToOutputDirectory="Always" />
<None Include="..\README.md" Pack="true" PackagePath="" CopyToOutputDirectory="Always" />
</ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="FluentValidation" Version="10.4.0" /> <PackageReference Include="FluentValidation" Version="10.4.0" />
</ItemGroup> </ItemGroup>
@@ -1,4 +1,5 @@
using FluentValidation; using System.Diagnostics.CodeAnalysis;
using FluentValidation;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using OpenHarbor.CQRS.Abstractions; using OpenHarbor.CQRS.Abstractions;
@@ -6,14 +7,14 @@ namespace OpenHarbor.CQRS.FluentValidation;
public static class ServiceCollectionExtensions public static class ServiceCollectionExtensions
{ {
private static IServiceCollection AddFluentValidator<T, TValidator>(this IServiceCollection services) private static IServiceCollection AddFluentValidator<T, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TValidator>(this IServiceCollection services)
where TValidator : class, IValidator<T> where TValidator : class, IValidator<T>
{ {
services.AddTransient<IValidator<T>, TValidator>(); services.AddTransient<IValidator<T>, TValidator>();
return services; return services;
} }
public static IServiceCollection AddCommand<TCommand, TCommandHandler, TValidator>(this IServiceCollection services) public static IServiceCollection AddCommand<TCommand, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TCommandHandler, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TValidator>(this IServiceCollection services)
where TCommand : class where TCommand : class
where TCommandHandler : class, ICommandHandler<TCommand> where TCommandHandler : class, ICommandHandler<TCommand>
where TValidator : class, IValidator<TCommand> where TValidator : class, IValidator<TCommand>
@@ -22,7 +23,7 @@ public static class ServiceCollectionExtensions
.AddFluentValidator<TCommand, TValidator>(); .AddFluentValidator<TCommand, TValidator>();
} }
public static IServiceCollection AddCommand<TCommand, TCommandResult, TCommandHandler, TValidator>(this IServiceCollection services) public static IServiceCollection AddCommand<TCommand, TCommandResult, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TCommandHandler, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TValidator>(this IServiceCollection services)
where TCommand : class where TCommand : class
where TCommandHandler : class, ICommandHandler<TCommand, TCommandResult> where TCommandHandler : class, ICommandHandler<TCommand, TCommandResult>
where TValidator : class, IValidator<TCommand> where TValidator : class, IValidator<TCommand>
@@ -31,13 +32,14 @@ public static class ServiceCollectionExtensions
.AddFluentValidator<TCommand, TValidator>(); .AddFluentValidator<TCommand, TValidator>();
} }
public static IServiceCollection AddQuery<TQuery, TQueryResult, TQueryHandler, TValidator>(this IServiceCollection services) public static IServiceCollection AddQuery<TQuery, TQueryResult, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TQueryHandler, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TValidator>(this IServiceCollection services)
where TQuery : class where TQuery : class
where TQueryHandler : class, IQueryHandler<TQuery, TQueryResult> where TQueryHandler : class, IQueryHandler<TQuery, TQueryResult>
where TValidator : class, IValidator<TQuery> where TValidator : class, IValidator<TQuery>
{ {
services.AddQuery<TQuery, TQueryResult, TQueryHandler>() services.AddQuery<TQuery, TQueryResult, TQueryHandler>()
.AddFluentValidator<TQuery, TValidator>(); .AddFluentValidator<TQuery, TValidator>();
return services; return services;
} }
} }
BIN
View File
Binary file not shown.
+20 -2
View File
@@ -1,11 +1,29 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework> <TargetFramework>net8.0</TargetFramework>
<PackageIconUrl>https://avatars.githubusercontent.com/u/52874619?v=4</PackageIconUrl> <IsAotCompatible>true</IsAotCompatible>
<Authors>David Lebee, Mathias Beaulieu-Duncan</Authors> <Authors>David Lebee, Mathias Beaulieu-Duncan</Authors>
<LangVersion>default</LangVersion> <LangVersion>default</LangVersion>
<Company>Open Harbor</Company>
<PackageIcon>icon.png</PackageIcon>
<PackageReadmeFile>README.md</PackageReadmeFile>
<RepositoryUrl>https://git.openharbor.io/Open-Harbor/dotnet-cqrs</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<DebugType>portable</DebugType>
<DebugSymbols>true</DebugSymbols>
<IncludeSymbols>true</IncludeSymbols>
<IncludeSource>true</IncludeSource>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
</PropertyGroup> </PropertyGroup>
<ItemGroup>
<None Include="..\icon.png" Pack="true" PackagePath="" CopyToOutputDirectory="Always" />
<None Include="..\README.md" Pack="true" PackagePath="" CopyToOutputDirectory="Always" />
</ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\OpenHarbor.CQRS.Abstractions\OpenHarbor.CQRS.Abstractions.csproj" /> <ProjectReference Include="..\OpenHarbor.CQRS.Abstractions\OpenHarbor.CQRS.Abstractions.csproj" />
</ItemGroup> </ItemGroup>
+34 -24
View File
@@ -1,4 +1,4 @@
# This project is a fork of [PoweredSoft.CQRS](https://github.com/PoweredSoft/CQRS) > This project was originally initiated by [Powered Software Inc.](https://poweredsoft.com/) and was forked from the [PoweredSoft.CQRS](https://github.com/PoweredSoft/CQRS) Repository
# CQRS # CQRS
@@ -8,14 +8,21 @@ Our implementation of query and command responsibility segregation (CQRS).
> Install nuget package to your awesome project. > Install nuget package to your awesome project.
| Full Version | NuGet | NuGet Install |
|-----------------------------------------| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |-----------------------------------------------------------------------:|
| OpenHarbor.CQRS | <a href="https://www.nuget.org/packages/OpenHarbor.CQRS/" target="_blank">[![NuGet](https://img.shields.io/nuget/v/OpenHarbor.CQRS.svg?style=flat-square&label=nuget)](https://www.nuget.org/packages/OpenHarbor.CQRS/)</a> | ```PM> Install-Package OpenHarbor.CQRS ``` |
| OpenHarbor.CQRS.AspNetCore | <a href="https://www.nuget.org/packages/OpenHarbor.CQRS.AspNetCore/" target="_blank">[![NuGet](https://img.shields.io/nuget/v/OpenHarbor.CQRS.AspNetCore.svg?style=flat-square&label=nuget)](https://www.nuget.org/packages/OpenHarbor.CQRS.AspNetCore/)</a> | ```PM> Install-Package OpenHarbor.CQRS.AspNetCore ``` |
| OpenHarbor.CQRS.FluentValidation | <a href="https://www.nuget.org/packages/OpenHarbor.CQRS.FluentValidation/" target="_blank">[![NuGet](https://img.shields.io/nuget/v/OpenHarbor.CQRS.FluentValidation.svg?style=flat-square&label=nuget)](https://www.nuget.org/packages/OpenHarbor.CQRS.FluentValidation/)</a> | ```PM> Install-Package OpenHarbor.CQRS.FluentValidation ``` |
| OpenHarbor.CQRS.DynamicQuery | <a href="https://www.nuget.org/packages/OpenHarbor.CQRS.DynamicQuery/" target="_blank">[![NuGet](https://img.shields.io/nuget/v/OpenHarbor.CQRS.DynamicQuery.svg?style=flat-square&label=nuget)](https://www.nuget.org/packages/OpenHarbor.CQRS.DynamicQuery/)</a> | ```PM> Install-Package OpenHarbor.CQRS.DynamicQuery ``` |
| OpenHarbor.CQRS.DynamicQuery.AspNetCore | <a href="https://www.nuget.org/packages/OpenHarbor.CQRS.DynamicQuery.AspNetCore/" target="_blank">[![NuGet](https://img.shields.io/nuget/v/OpenHarbor.CQRS.DynamicQuery.AspNetCore.svg?style=flat-square&label=nuget)](https://www.nuget.org/packages/OpenHarbor.CQRS.DynamicQuery.AspNetCore/)</a> | ```PM> Install-Package OpenHarbor.CQRS.DynamicQuery.AspNetCore ``` |
> Abstractions Packages.
| Full Version | NuGet | NuGet Install | | 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 ``` | | OpenHarbor.CQRS.Abstractions | <a href="https://www.nuget.org/packages/OpenHarbor.CQRS.Abstractions/" target="_blank">[![NuGet](https://img.shields.io/nuget/v/OpenHarbor.CQRS.Abstractions.svg?style=flat-square&label=nuget)](https://www.nuget.org/packages/OpenHarbor.CQRS.Abstractions/)</a> | ```PM> Install-Package OpenHarbor.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 ``` | | OpenHarbor.CQRS.AspNetCore.Abstractions | <a href="https://www.nuget.org/packages/OpenHarbor.CQRS.AspNetCore.Abstractions/" target="_blank">[![NuGet](https://img.shields.io/nuget/v/OpenHarbor.CQRS.AspNetCore.Abstractions.svg?style=flat-square&label=nuget)](https://www.nuget.org/packages/OpenHarbor.CQRS.AspNetCore.Abstractions/)</a> | ```PM> Install-Package OpenHarbor.CQRS.AspNetCore.Abstractions ``` |
| PoweredSoft.CQRS.FluentValidation | <a href="https://www.nuget.org/packages/PoweredSoft.CQRS.FluentValidation/" target="_blank">[![NuGet](https://img.shields.io/nuget/v/PoweredSoft.CQRS.FluentValidation.svg?style=flat-square&label=nuget)](https://www.nuget.org/packages/PoweredSoft.CQRS.FluentValidation/)</a> | ```PM> Install-Package PoweredSoft.CQRS.FluentValidation ``` | | OpenHarbor.CQRS.DynamicQuery.Abstractions | <a href="https://www.nuget.org/packages/OpenHarbor.CQRS.DynamicQuery.Abstractions/" target="_blank">[![NuGet](https://img.shields.io/nuget/v/OpenHarbor.CQRS.DynamicQuery.Abstractions.svg?style=flat-square&label=nuget)](https://www.nuget.org/packages/OpenHarbor.CQRS.DynamicQuery.Abstractions/)</a> | ```PM> Install-Package OpenHarbor.CQRS.AspNetCore.Abstractions ``` |
| 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 ``` |
| PoweredSoft.CQRS.GraphQL.HotChocolate | <a href="https://www.nuget.org/packages/PoweredSoft.CQRS.GraphQL.HotChocolate/" target="_blank">[![NuGet](https://img.shields.io/nuget/v/PoweredSoft.CQRS.GraphQL.HotChocolate.svg?style=flat-square&label=nuget)](https://www.nuget.org/packages/PoweredSoft.CQRS.GraphQL.HotChocolate/)</a> | ```PM> Install-Package PoweredSoft.CQRS.GraphQL.HotChocolate ``` |
## Sample of startup code for aspnetcore MVC ## Sample of startup code for aspnetcore MVC
@@ -23,29 +30,19 @@ Our implementation of query and command responsibility segregation (CQRS).
```csharp ```csharp
public void ConfigureServices(IServiceCollection services) public void ConfigureServices(IServiceCollection services)
{ {
// make sure to add your queries and commands before the .AddPoweredSoftQueries and .AddPoweredSoftCommands // make sure to add your queries and commands before configuring MvCBuilder with .AddOpenHarborCommands and .AddOpenHarborQueries
AddQueries(services); AddQueries(services);
AddCommands(services); AddCommands(services);
// adds the non related to aspnet core features. // adds the non related to aspnet core features.
services.AddPoweredSoftCQRS(); services.AddOpenHarborCQRS();
services services
.AddControllers() .AddControllers()
.AddPoweredSoftQueries() // adds queries to aspnetcore mvc.(you can make it configurable to load balance only commands on a instance) .AddOpenHarborQueries() // adds queries to aspnetcore mvc.(you can make it configurable to load balance only commands on a instance)
.AddPoweredSoftCommands() // adds commands to aspnetcore mvc. (you can make it configurable to load balance only commands on a instance) .AddOpenHarborCommands() // adds commands to aspnetcore mvc. (you can make it configurable to load balance only commands on a instance)
.AddFluentValidation(); .AddFluentValidation();
// enabling gql.
services
.AddGraphQLServer()
.AddProjections()
.AddQueryType(d => d.Name("Query"))
.AddPoweredSoftQueries()
.AddPoweredSoftDynamicQueries()
.AddMutationType(d => d.Name("Mutation"))
.AddPoweredSoftMutations();
services.AddSwaggerGen(); services.AddSwaggerGen();
} }
``` ```
@@ -66,11 +63,12 @@ private void AddQueries(IServiceCollection services)
services.AddQuery<PersonQuery, IQueryable<Person>, PersonQueryHandler>(); services.AddQuery<PersonQuery, IQueryable<Person>, PersonQueryHandler>();
} }
``` ```
# Fluent Validation # Fluent Validation
We use fluent validation in all of our projects, but we don't want it to be enforced. We use fluent validation in all of our projects, but we don't want it to be enforced.
If you install. ```PoweredSoft.CQRS.FluentValidation``` you can use this way of registrating your commands. If you install ```OpenHarbor.CQRS.FluentValidation``` you can use this way of registrating your commands.
```csharp ```csharp
public void ConfigureServices(IServiceCollection services) public void ConfigureServices(IServiceCollection services)
@@ -82,7 +80,19 @@ public void ConfigureServices(IServiceCollection services)
public void ConfigureServices(IServiceCollection services) public void ConfigureServices(IServiceCollection services)
{ {
// with PoweredSoft.CQRS.FluentValidation package. // with OpenHarbor.CQRS.FluentValidation package.
services.AddCommandWithValidator<EchoCommand, string, EchoCommandHandler, EchoCommandValidator>(); services.AddCommand<EchoCommand, string, EchoCommandHandler, EchoCommandValidator>();
} }
``` ```
# 2024 Roadmap
| Task | Description | Status |
|----------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------|--------|
| Support .NET 8 | Ensure compatibility with .NET 8. | ✅ |
| Create a new demo project as an example | Develop a new demo project to serve as an example for users. | ⬜️ |
| New Independent Module for MVC | Develop a standalone module, independent of MVC, to enhance framework flexibility. | ⬜️ |
| Implement .NET Native Compilation (AOT) | Enable Ahead-of-Time (AOT) compilation support for .NET 8. | ⬜️ |
| Update FluentValidation | Upgrade FluentValidation to the latest version, addressing potential breaking changes. | ⬜️ |
| Create a website for the Framework | Develop a website to host comprehensive documentation for the framework. | ⬜️ |
| Re-add support for GraphQL | Re-integrate support for GraphQL, exploring lightweight solutions. | ⬜️ |
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB