Skip to content

Commit e0e28bc

Browse files
louisaxel-ambroisedependabot-preview[bot]devhoid
authored
Merge from Develop (#304)
* v2.1.3 (#295) * FasTnT EPCIS 2.0.1 (#175) * Bump Microsoft.Extensions.DependencyInjection from 3.1.1 to 3.1.2 Bumps [Microsoft.Extensions.DependencyInjection](https://github.com/aspnet/Extensions) from 3.1.1 to 3.1.2. - [Release notes](https://github.com/aspnet/Extensions/releases) - [Commits](dotnet/extensions@v3.1.1...v3.1.2) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> * Bump Microsoft.Extensions.Logging.Abstractions from 3.1.1 to 3.1.2 Bumps [Microsoft.Extensions.Logging.Abstractions](https://github.com/aspnet/Extensions) from 3.1.1 to 3.1.2. - [Release notes](https://github.com/aspnet/Extensions/releases) - [Commits](dotnet/extensions@v3.1.1...v3.1.2) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> * Bump Microsoft.Extensions.Logging from 3.1.1 to 3.1.2 Bumps [Microsoft.Extensions.Logging](https://github.com/aspnet/Extensions) from 3.1.1 to 3.1.2. - [Release notes](https://github.com/aspnet/Extensions/releases) - [Commits](dotnet/extensions@v3.1.1...v3.1.2) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> * Bump Npgsql from 4.1.3 to 4.1.3.1 Bumps [Npgsql](https://github.com/npgsql/npgsql) from 4.1.3 to 4.1.3.1. - [Release notes](https://github.com/npgsql/npgsql/releases) - [Commits](npgsql/npgsql@v4.1.3...v4.1.3.1) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> * Add command lines parameters (#159) * Add command lines parameters * Add unit tests * Bump MediatR from 8.0.0 to 8.0.1 (#160) Bumps [MediatR](https://github.com/jbogard/mediatr) from 8.0.0 to 8.0.1. - [Release notes](https://github.com/jbogard/mediatr/releases) - [Commits](jbogard/MediatR@v8.0.0...v8.0.1) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> * Implement parameters (#161) * Implement parameters - EQATTR - HASATTR - "**_"-like parameters - "**_INNER_"-like parameters * Bump Microsoft.Extensions.Configuration.CommandLine from 3.1.2 to 3.1.3 (#162) Bumps [Microsoft.Extensions.Configuration.CommandLine](https://github.com/aspnet/Extensions) from 3.1.2 to 3.1.3. - [Release notes](https://github.com/aspnet/Extensions/releases) - [Commits](dotnet/extensions@v3.1.2...v3.1.3) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> * Bump Microsoft.Extensions.Logging.Abstractions from 3.1.2 to 3.1.3 (#163) Bumps [Microsoft.Extensions.Logging.Abstractions](https://github.com/aspnet/Extensions) from 3.1.2 to 3.1.3. - [Release notes](https://github.com/aspnet/Extensions/releases) - [Commits](dotnet/extensions@v3.1.2...v3.1.3) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> * Bump Microsoft.Extensions.DependencyInjection from 3.1.2 to 3.1.3 (#167) Bumps [Microsoft.Extensions.DependencyInjection](https://github.com/aspnet/Extensions) from 3.1.2 to 3.1.3. - [Release notes](https://github.com/aspnet/Extensions/releases) - [Commits](dotnet/extensions@v3.1.2...v3.1.3) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> * Bump Microsoft.Extensions.Logging from 3.1.2 to 3.1.3 (#164) Bumps [Microsoft.Extensions.Logging](https://github.com/aspnet/Extensions) from 3.1.2 to 3.1.3. - [Release notes](https://github.com/aspnet/Extensions/releases) - [Commits](dotnet/extensions@v3.1.2...v3.1.3) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> * Add XML/SOAP parsing tests (#168) * Add unit tests * Add XML parsing unit tests * Update WhenParsingXmlGetSubscriptionIDsRequest.cs * Add XML parsing unit tests * Add SOAP parsing unit tests Co-authored-by: Louis-Axel Ambroise <ambroise.la@gmail.com> * Use .NET Core 3.1 LTS (#169) * Update solution to use .NET Core 3.1 Use the latest LTS 3.1 framework * Update dotnetcore.yml Use .NET Core 3.1 in Github workflow Co-authored-by: Louis-Axel Ambroise <ambroise.la@gmail.com> * Fix/http status code (#170) * Return 200 instead of 204 As specified in compliance document * Fix tests Co-authored-by: Louis-Axel Ambroise <ambroise.la@gmail.com> * Update README.md Update .NET Core version requirement * Cleanup code (#171) * Cleanup Host code * Cleanup and update NuGet Co-authored-by: Louis-Axel Ambroise <ambroise.la@gmail.com> * Fix XML formatting (#172) Add missing condition on ErrorDeclaration field existance Co-authored-by: Louis-Axel Ambroise <ambroise.la@gmail.com> * Fix azure deployment (#173) Use IIS Integration instead of Kestrel Co-authored-by: Louis-Axel Ambroise <ambroise.la@gmail.com> * Bump version to 2.0.1 & cleanup code (#174) Co-authored-by: Louis-Axel Ambroise <ambroise.la@gmail.com> Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> Co-authored-by: Louis-Axel Ambroise <ambroise.la@gmail.com> * Complete merge from develop * Merge Develop into Master (#280) * Update dotnetcore.yml (#247) * Update dotnetcore.yml Run integration tests + coverage * Update dotnetcore.yml * Cleanup SimpleEventQuery.cs (#255) Co-authored-by: Louis-Axel Ambroise <ambroise.la@gmail.com> * Bump Microsoft.AspNetCore.TestHost from 3.1.7 to 3.1.8 (#261) Bumps [Microsoft.AspNetCore.TestHost](https://github.com/aspnet/AspNetCore) from 3.1.7 to 3.1.8. - [Release notes](https://github.com/aspnet/AspNetCore/releases) - [Commits](dotnet/aspnetcore@v3.1.7...v3.1.8) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> * Bump Microsoft.Extensions.Logging.Abstractions from 3.1.7 to 3.1.8 (#260) Bumps [Microsoft.Extensions.Logging.Abstractions](https://github.com/aspnet/Extensions) from 3.1.7 to 3.1.8. - [Release notes](https://github.com/aspnet/Extensions/releases) - [Commits](dotnet/extensions@v3.1.7...v3.1.8) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> * Bump Microsoft.Extensions.Configuration.CommandLine from 3.1.7 to 3.1.8 (#256) Bumps [Microsoft.Extensions.Configuration.CommandLine](https://github.com/aspnet/Extensions) from 3.1.7 to 3.1.8. - [Release notes](https://github.com/aspnet/Extensions/releases) - [Commits](dotnet/extensions@v3.1.7...v3.1.8) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> * Bump Microsoft.Extensions.DependencyInjection from 3.1.7 to 3.1.8 (#257) Bumps [Microsoft.Extensions.DependencyInjection](https://github.com/aspnet/Extensions) from 3.1.7 to 3.1.8. - [Release notes](https://github.com/aspnet/Extensions/releases) - [Commits](dotnet/extensions@v3.1.7...v3.1.8) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> * Bump Microsoft.Extensions.Logging from 3.1.7 to 3.1.8 (#259) Bumps [Microsoft.Extensions.Logging](https://github.com/aspnet/Extensions) from 3.1.7 to 3.1.8. - [Release notes](https://github.com/aspnet/Extensions/releases) - [Commits](dotnet/extensions@v3.1.7...v3.1.8) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> * Small changes & improvements (#262) Co-authored-by: Louis-Axel Ambroise <ambroise.la@gmail.com> * Bump Npgsql from 4.1.4 to 4.1.5 (#263) Bumps [Npgsql](https://github.com/npgsql/npgsql) from 4.1.4 to 4.1.5. - [Release notes](https://github.com/npgsql/npgsql/releases) - [Commits](npgsql/npgsql@v4.1.4...v4.1.5) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> * Bump Moq from 4.14.5 to 4.14.6 (#264) Bumps [Moq](https://github.com/moq/moq4) from 4.14.5 to 4.14.6. - [Release notes](https://github.com/moq/moq4/releases) - [Changelog](https://github.com/moq/moq4/blob/master/CHANGELOG.md) - [Commits](devlooped/moq@v4.14.5...v4.14.6) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> * Bump MediatR from 8.1.0 to 8.2.0 (#265) Bumps [MediatR](https://github.com/jbogard/MediatR) from 8.1.0 to 8.2.0. - [Release notes](https://github.com/jbogard/MediatR/releases) - [Commits](jbogard/MediatR@v8.1.0...v8.2.0) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> * Bump Microsoft.Extensions.Configuration.CommandLine from 3.1.8 to 3.1.9 (#273) Bumps [Microsoft.Extensions.Configuration.CommandLine](https://github.com/aspnet/Extensions) from 3.1.8 to 3.1.9. - [Release notes](https://github.com/aspnet/Extensions/releases) - [Commits](dotnet/extensions@v3.1.8...v3.1.9) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> * Bump MediatR from 8.2.0 to 9.0.0 (#267) Bumps [MediatR](https://github.com/jbogard/MediatR) from 8.2.0 to 9.0.0. - [Release notes](https://github.com/jbogard/MediatR/releases) - [Commits](https://github.com/jbogard/MediatR/commits/v9.0.0) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> * Bump Microsoft.AspNetCore.TestHost from 3.1.8 to 3.1.9 (#268) Bumps [Microsoft.AspNetCore.TestHost](https://github.com/aspnet/AspNetCore) from 3.1.8 to 3.1.9. - [Release notes](https://github.com/aspnet/AspNetCore/releases) - [Commits](dotnet/aspnetcore@v3.1.8...v3.1.9) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> * Improve bulk performances by tuning parametrs (#275) Co-authored-by: Louis-Axel Ambroise <ambroise.la@gmail.com> * Bump Microsoft.Extensions.Logging.Abstractions from 3.1.8 to 3.1.9 (#271) Bumps [Microsoft.Extensions.Logging.Abstractions](https://github.com/aspnet/Extensions) from 3.1.8 to 3.1.9. - [Release notes](https://github.com/aspnet/Extensions/releases) - [Commits](dotnet/extensions@v3.1.8...v3.1.9) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> * Bump Microsoft.Extensions.DependencyInjection from 3.1.8 to 3.1.9 (#272) Bumps [Microsoft.Extensions.DependencyInjection](https://github.com/aspnet/Extensions) from 3.1.8 to 3.1.9. - [Release notes](https://github.com/aspnet/Extensions/releases) - [Commits](dotnet/extensions@v3.1.8...v3.1.9) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> * Bump Moq from 4.14.6 to 4.14.7 (#274) Bumps [Moq](https://github.com/moq/moq4) from 4.14.6 to 4.14.7. - [Release notes](https://github.com/moq/moq4/releases) - [Changelog](https://github.com/moq/moq4/blob/master/CHANGELOG.md) - [Commits](devlooped/moq@v4.14.6...v4.14.7) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> * Bump MediatR.Extensions.Microsoft.DependencyInjection (#266) Bumps [MediatR.Extensions.Microsoft.DependencyInjection](https://github.com/jbogard/MediatR.Extensions.Microsoft.DependencyInjection) from 8.1.0 to 9.0.0. - [Release notes](https://github.com/jbogard/MediatR.Extensions.Microsoft.DependencyInjection/releases) - [Commits](jbogard/MediatR.Extensions.Microsoft.DependencyInjection@v8.1.0...v9.0.0) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> * Bump Microsoft.Extensions.Logging from 3.1.8 to 3.1.9 (#269) Bumps [Microsoft.Extensions.Logging](https://github.com/aspnet/Extensions) from 3.1.8 to 3.1.9. - [Release notes](https://github.com/aspnet/Extensions/releases) - [Commits](dotnet/extensions@v3.1.8...v3.1.9) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> * Bump Microsoft.Extensions.Hosting from 3.1.7 to 3.1.9 (#270) Bumps [Microsoft.Extensions.Hosting](https://github.com/aspnet/Extensions) from 3.1.7 to 3.1.9. - [Release notes](https://github.com/aspnet/Extensions/releases) - [Commits](dotnet/extensions@v3.1.7...v3.1.9) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> * Add CancellationToken to XML formatter (#276) * Use CancellationToken in events/masterdata formatting to avoid having hanging long queries (WIP) * Check for cancelled query when formatting XML response Co-authored-by: Louis-Axel Ambroise <ambroise.la@gmail.com> * Fix naming * Update SimpleEventQuery.cs * Remove UserSecrets * Update BasicAuthenticationHandler.cs * Handle request cancellation during event retrieving (#277) Co-authored-by: Louis-Axel Ambroise <ambroise.la@gmail.com> * Fix Subscription SQL store (#278) Co-authored-by: Louis-Axel Ambroise <ambroise.la@gmail.com> * Use C# 8 using statement (#279) + cleanup unused namespaces Co-authored-by: Louis-Axel Ambroise <ambroise.la@gmail.com> Co-authored-by: Louis-Axel Ambroise <ambroise.la@gmail.com> Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> * Bump version Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> Co-authored-by: Louis-Axel Ambroise <ambroise.la@gmail.com> * Bump Moq from 4.14.7 to 4.15.1 (#296) Bumps [Moq](https://github.com/moq/moq4) from 4.14.7 to 4.15.1. - [Release notes](https://github.com/moq/moq4/releases) - [Changelog](https://github.com/moq/moq4/blob/master/CHANGELOG.md) - [Commits](https://github.com/moq/moq4/commits) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> * Bump Npgsql from 4.1.5 to 5.0.0 (#297) Bumps [Npgsql](https://github.com/npgsql/npgsql) from 4.1.5 to 5.0.0. - [Release notes](https://github.com/npgsql/npgsql/releases) - [Commits](npgsql/npgsql@v4.1.5...v5.0.0) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> * Bump Dapper from 2.0.35 to 2.0.78 (#299) Bumps [Dapper](https://github.com/StackExchange/Dapper) from 2.0.35 to 2.0.78. - [Release notes](https://github.com/StackExchange/Dapper/releases) - [Commits](https://github.com/StackExchange/Dapper/commits) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> * Bump Dapper.SqlBuilder from 2.0.35 to 2.0.78 (#300) Bumps [Dapper.SqlBuilder](https://github.com/StackExchange/Dapper) from 2.0.35 to 2.0.78. - [Release notes](https://github.com/StackExchange/Dapper/releases) - [Commits](https://github.com/StackExchange/Dapper/commits) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> * Use .NET Core 5 (#298) * FasTnT EPCIS 2.0.1 (#175) * Bump Microsoft.Extensions.DependencyInjection from 3.1.1 to 3.1.2 Bumps [Microsoft.Extensions.DependencyInjection](https://github.com/aspnet/Extensions) from 3.1.1 to 3.1.2. - [Release notes](https://github.com/aspnet/Extensions/releases) - [Commits](dotnet/extensions@v3.1.1...v3.1.2) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> * Bump Microsoft.Extensions.Logging.Abstractions from 3.1.1 to 3.1.2 Bumps [Microsoft.Extensions.Logging.Abstractions](https://github.com/aspnet/Extensions) from 3.1.1 to 3.1.2. - [Release notes](https://github.com/aspnet/Extensions/releases) - [Commits](dotnet/extensions@v3.1.1...v3.1.2) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> * Bump Microsoft.Extensions.Logging from 3.1.1 to 3.1.2 Bumps [Microsoft.Extensions.Logging](https://github.com/aspnet/Extensions) from 3.1.1 to 3.1.2. - [Release notes](https://github.com/aspnet/Extensions/releases) - [Commits](dotnet/extensions@v3.1.1...v3.1.2) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> * Bump Npgsql from 4.1.3 to 4.1.3.1 Bumps [Npgsql](https://github.com/npgsql/npgsql) from 4.1.3 to 4.1.3.1. - [Release notes](https://github.com/npgsql/npgsql/releases) - [Commits](npgsql/npgsql@v4.1.3...v4.1.3.1) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> * Add command lines parameters (#159) * Add command lines parameters * Add unit tests * Bump MediatR from 8.0.0 to 8.0.1 (#160) Bumps [MediatR](https://github.com/jbogard/mediatr) from 8.0.0 to 8.0.1. - [Release notes](https://github.com/jbogard/mediatr/releases) - [Commits](jbogard/MediatR@v8.0.0...v8.0.1) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> * Implement parameters (#161) * Implement parameters - EQATTR - HASATTR - "**_"-like parameters - "**_INNER_"-like parameters * Bump Microsoft.Extensions.Configuration.CommandLine from 3.1.2 to 3.1.3 (#162) Bumps [Microsoft.Extensions.Configuration.CommandLine](https://github.com/aspnet/Extensions) from 3.1.2 to 3.1.3. - [Release notes](https://github.com/aspnet/Extensions/releases) - [Commits](dotnet/extensions@v3.1.2...v3.1.3) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> * Bump Microsoft.Extensions.Logging.Abstractions from 3.1.2 to 3.1.3 (#163) Bumps [Microsoft.Extensions.Logging.Abstractions](https://github.com/aspnet/Extensions) from 3.1.2 to 3.1.3. - [Release notes](https://github.com/aspnet/Extensions/releases) - [Commits](dotnet/extensions@v3.1.2...v3.1.3) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> * Bump Microsoft.Extensions.DependencyInjection from 3.1.2 to 3.1.3 (#167) Bumps [Microsoft.Extensions.DependencyInjection](https://github.com/aspnet/Extensions) from 3.1.2 to 3.1.3. - [Release notes](https://github.com/aspnet/Extensions/releases) - [Commits](dotnet/extensions@v3.1.2...v3.1.3) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> * Bump Microsoft.Extensions.Logging from 3.1.2 to 3.1.3 (#164) Bumps [Microsoft.Extensions.Logging](https://github.com/aspnet/Extensions) from 3.1.2 to 3.1.3. - [Release notes](https://github.com/aspnet/Extensions/releases) - [Commits](dotnet/extensions@v3.1.2...v3.1.3) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> * Add XML/SOAP parsing tests (#168) * Add unit tests * Add XML parsing unit tests * Update WhenParsingXmlGetSubscriptionIDsRequest.cs * Add XML parsing unit tests * Add SOAP parsing unit tests Co-authored-by: Louis-Axel Ambroise <ambroise.la@gmail.com> * Use .NET Core 3.1 LTS (#169) * Update solution to use .NET Core 3.1 Use the latest LTS 3.1 framework * Update dotnetcore.yml Use .NET Core 3.1 in Github workflow Co-authored-by: Louis-Axel Ambroise <ambroise.la@gmail.com> * Fix/http status code (#170) * Return 200 instead of 204 As specified in compliance document * Fix tests Co-authored-by: Louis-Axel Ambroise <ambroise.la@gmail.com> * Update README.md Update .NET Core version requirement * Cleanup code (#171) * Cleanup Host code * Cleanup and update NuGet Co-authored-by: Louis-Axel Ambroise <ambroise.la@gmail.com> * Fix XML formatting (#172) Add missing condition on ErrorDeclaration field existance Co-authored-by: Louis-Axel Ambroise <ambroise.la@gmail.com> * Fix azure deployment (#173) Use IIS Integration instead of Kestrel Co-authored-by: Louis-Axel Ambroise <ambroise.la@gmail.com> * Bump version to 2.0.1 & cleanup code (#174) Co-authored-by: Louis-Axel Ambroise <ambroise.la@gmail.com> Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> Co-authored-by: Louis-Axel Ambroise <ambroise.la@gmail.com> * Complete merge from develop * Merge Develop into Master (#280) * Update dotnetcore.yml (#247) * Update dotnetcore.yml Run integration tests + coverage * Update dotnetcore.yml * Cleanup SimpleEventQuery.cs (#255) Co-authored-by: Louis-Axel Ambroise <ambroise.la@gmail.com> * Bump Microsoft.AspNetCore.TestHost from 3.1.7 to 3.1.8 (#261) Bumps [Microsoft.AspNetCore.TestHost](https://github.com/aspnet/AspNetCore) from 3.1.7 to 3.1.8. - [Release notes](https://github.com/aspnet/AspNetCore/releases) - [Commits](dotnet/aspnetcore@v3.1.7...v3.1.8) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> * Bump Microsoft.Extensions.Logging.Abstractions from 3.1.7 to 3.1.8 (#260) Bumps [Microsoft.Extensions.Logging.Abstractions](https://github.com/aspnet/Extensions) from 3.1.7 to 3.1.8. - [Release notes](https://github.com/aspnet/Extensions/releases) - [Commits](dotnet/extensions@v3.1.7...v3.1.8) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> * Bump Microsoft.Extensions.Configuration.CommandLine from 3.1.7 to 3.1.8 (#256) Bumps [Microsoft.Extensions.Configuration.CommandLine](https://github.com/aspnet/Extensions) from 3.1.7 to 3.1.8. - [Release notes](https://github.com/aspnet/Extensions/releases) - [Commits](dotnet/extensions@v3.1.7...v3.1.8) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> * Bump Microsoft.Extensions.DependencyInjection from 3.1.7 to 3.1.8 (#257) Bumps [Microsoft.Extensions.DependencyInjection](https://github.com/aspnet/Extensions) from 3.1.7 to 3.1.8. - [Release notes](https://github.com/aspnet/Extensions/releases) - [Commits](dotnet/extensions@v3.1.7...v3.1.8) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> * Bump Microsoft.Extensions.Logging from 3.1.7 to 3.1.8 (#259) Bumps [Microsoft.Extensions.Logging](https://github.com/aspnet/Extensions) from 3.1.7 to 3.1.8. - [Release notes](https://github.com/aspnet/Extensions/releases) - [Commits](dotnet/extensions@v3.1.7...v3.1.8) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> * Small changes & improvements (#262) Co-authored-by: Louis-Axel Ambroise <ambroise.la@gmail.com> * Bump Npgsql from 4.1.4 to 4.1.5 (#263) Bumps [Npgsql](https://github.com/npgsql/npgsql) from 4.1.4 to 4.1.5. - [Release notes](https://github.com/npgsql/npgsql/releases) - [Commits](npgsql/npgsql@v4.1.4...v4.1.5) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> * Bump Moq from 4.14.5 to 4.14.6 (#264) Bumps [Moq](https://github.com/moq/moq4) from 4.14.5 to 4.14.6. - [Release notes](https://github.com/moq/moq4/releases) - [Changelog](https://github.com/moq/moq4/blob/master/CHANGELOG.md) - [Commits](devlooped/moq@v4.14.5...v4.14.6) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> * Bump MediatR from 8.1.0 to 8.2.0 (#265) Bumps [MediatR](https://github.com/jbogard/MediatR) from 8.1.0 to 8.2.0. - [Release notes](https://github.com/jbogard/MediatR/releases) - [Commits](jbogard/MediatR@v8.1.0...v8.2.0) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> * Bump Microsoft.Extensions.Configuration.CommandLine from 3.1.8 to 3.1.9 (#273) Bumps [Microsoft.Extensions.Configuration.CommandLine](https://github.com/aspnet/Extensions) from 3.1.8 to 3.1.9. - [Release notes](https://github.com/aspnet/Extensions/releases) - [Commits](dotnet/extensions@v3.1.8...v3.1.9) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> * Bump MediatR from 8.2.0 to 9.0.0 (#267) Bumps [MediatR](https://github.com/jbogard/MediatR) from 8.2.0 to 9.0.0. - [Release notes](https://github.com/jbogard/MediatR/releases) - [Commits](https://github.com/jbogard/MediatR/commits/v9.0.0) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> * Bump Microsoft.AspNetCore.TestHost from 3.1.8 to 3.1.9 (#268) Bumps [Microsoft.AspNetCore.TestHost](https://github.com/aspnet/AspNetCore) from 3.1.8 to 3.1.9. - [Release notes](https://github.com/aspnet/AspNetCore/releases) - [Commits](dotnet/aspnetcore@v3.1.8...v3.1.9) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> * Improve bulk performances by tuning parametrs (#275) Co-authored-by: Louis-Axel Ambroise <ambroise.la@gmail.com> * Bump Microsoft.Extensions.Logging.Abstractions from 3.1.8 to 3.1.9 (#271) Bumps [Microsoft.Extensions.Logging.Abstractions](https://github.com/aspnet/Extensions) from 3.1.8 to 3.1.9. - [Release notes](https://github.com/aspnet/Extensions/releases) - [Commits](dotnet/extensions@v3.1.8...v3.1.9) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> * Bump Microsoft.Extensions.DependencyInjection from 3.1.8 to 3.1.9 (#272) Bumps [Microsoft.Extensions.DependencyInjection](https://github.com/aspnet/Extensions) from 3.1.8 to 3.1.9. - [Release notes](https://github.com/aspnet/Extensions/releases) - [Commits](dotnet/extensions@v3.1.8...v3.1.9) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> * Bump Moq from 4.14.6 to 4.14.7 (#274) Bumps [Moq](https://github.com/moq/moq4) from 4.14.6 to 4.14.7. - [Release notes](https://github.com/moq/moq4/releases) - [Changelog](https://github.com/moq/moq4/blob/master/CHANGELOG.md) - [Commits](devlooped/moq@v4.14.6...v4.14.7) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> * Bump MediatR.Extensions.Microsoft.DependencyInjection (#266) Bumps [MediatR.Extensions.Microsoft.DependencyInjection](https://github.com/jbogard/MediatR.Extensions.Microsoft.DependencyInjection) from 8.1.0 to 9.0.0. - [Release notes](https://github.com/jbogard/MediatR.Extensions.Microsoft.DependencyInjection/releases) - [Commits](jbogard/MediatR.Extensions.Microsoft.DependencyInjection@v8.1.0...v9.0.0) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> * Bump Microsoft.Extensions.Logging from 3.1.8 to 3.1.9 (#269) Bumps [Microsoft.Extensions.Logging](https://github.com/aspnet/Extensions) from 3.1.8 to 3.1.9. - [Release notes](https://github.com/aspnet/Extensions/releases) - [Commits](dotnet/extensions@v3.1.8...v3.1.9) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> * Bump Microsoft.Extensions.Hosting from 3.1.7 to 3.1.9 (#270) Bumps [Microsoft.Extensions.Hosting](https://github.com/aspnet/Extensions) from 3.1.7 to 3.1.9. - [Release notes](https://github.com/aspnet/Extensions/releases) - [Commits](dotnet/extensions@v3.1.7...v3.1.9) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> * Add CancellationToken to XML formatter (#276) * Use CancellationToken in events/masterdata formatting to avoid having hanging long queries (WIP) * Check for cancelled query when formatting XML response Co-authored-by: Louis-Axel Ambroise <ambroise.la@gmail.com> * Fix naming * Update SimpleEventQuery.cs * Remove UserSecrets * Update BasicAuthenticationHandler.cs * Handle request cancellation during event retrieving (#277) Co-authored-by: Louis-Axel Ambroise <ambroise.la@gmail.com> * Fix Subscription SQL store (#278) Co-authored-by: Louis-Axel Ambroise <ambroise.la@gmail.com> * Use C# 8 using statement (#279) + cleanup unused namespaces Co-authored-by: Louis-Axel Ambroise <ambroise.la@gmail.com> Co-authored-by: Louis-Axel Ambroise <ambroise.la@gmail.com> Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> * Bump version * Use .NET5 and C# 9 * Code cleanup + remove warnings Cleanup useless "using" statements Use C# 9 substring format Apply suggestions from Rozlyn warnings/messages * Update NuGet packages Use v5.0.0 for .NET5 * Update Build workflow Use .NET5 * Update dotnetcore.yml * Update workflow + remove invalid tests * Update dotnetcore.yml * Update fastnt.template.json Set default .NET 5 * Update NuGet Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> Co-authored-by: Louis-Axel Ambroise <ambroise.la@gmail.com> * Use Directory.build.props to manage version (#301) * Update README.md * Bump Microsoft.NET.Test.Sdk (#303) Bumps [Microsoft.NET.Test.Sdk](https://github.com/microsoft/vstest) from 16.9.0-preview-20201020-06 to 16.9.0-preview-20201123-03. - [Release notes](https://github.com/microsoft/vstest/releases) - [Commits](microsoft/vstest@v16.9.0-preview-20201020-06...v16.9.0-preview-20201123-03) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> * Bump dbup-postgresql from 4.4.0 to 4.5.0 (#302) Bumps dbup-postgresql from 4.4.0 to 4.5.0. Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> * Update README.md * Bump version to 2.1.4 Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> Co-authored-by: Louis-Axel Ambroise <ambroise.la@gmail.com>
1 parent 2091728 commit e0e28bc

File tree

65 files changed

+439
-447
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+439
-447
lines changed

.azure/templates/fastnt.template.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@
260260
"[resourceId('Microsoft.Web/sites', parameters('apiName'))]"
261261
],
262262
"properties": {
263-
"netFrameworkVersion": "v4.0",
263+
"netFrameworkVersion": "v5.0",
264264
"use32BitWorkerProcess": true,
265265
"managedPipelineMode": "Integrated",
266266
"virtualApplications": [

.github/workflows/dotnetcore.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ jobs:
99

1010
steps:
1111
- uses: actions/checkout@v1
12-
- name: Setup .NET Core
13-
uses: actions/setup-dotnet@v1
12+
- name: Setup .NET5
13+
uses: actions/setup-dotnet@v1.7.2
1414
with:
15-
dotnet-version: 3.1.100
15+
dotnet-version: 5.0.100
1616
- name: Build with dotnet
1717
run: dotnet build -c Release /nodeReuse:false
1818

Directory.build.props

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<Project>
2+
<PropertyGroup>
3+
<Version>2.1.4</Version>
4+
<AssemblyVersion>2.1.4</AssemblyVersion>
5+
<Product>FasTnT EPCIS</Product>
6+
</PropertyGroup>
7+
</Project>

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
![Last Commit (develop)](https://img.shields.io/github/last-commit/FasTnT/Epcis/develop.svg?logo=github)
1+
[![Last Commit (develop)](https://img.shields.io/github/last-commit/FasTnT/Epcis/develop.svg?logo=github)](https://github.com/FasTnT/epcis/commits/develop)
22
![Build Status](https://github.com/FasTnT/epcis/workflows/.NET%20Core/badge.svg)
33
[![Maintainability](https://api.codeclimate.com/v1/badges/40672e48b92da57852d7/maintainability)](https://codeclimate.com/github/FasTnT/epcis/maintainability)
44
[![codecov](https://codecov.io/gh/FasTnT/epcis/branch/develop/graph/badge.svg)](https://codecov.io/gh/FasTnT/epcis)
@@ -8,13 +8,13 @@
88

99
# FasTnT EPCIS
1010

11-
FasTnT EPCIS is a lightweight GS1 EPCIS 1.2 repository written in C# using .NET Core 3.1 and backed with PostGreSQL database.
11+
FasTnT EPCIS is a lightweight GS1 EPCIS 1.2 repository written in C# using .NET 5 and backed with PostGreSQL database.
1212

1313
## Setup
1414

1515
Prerequisites:
1616
- PostGreSQL 9.5 or higher
17-
- .NET Core 3.1 SDK
17+
- .NET 5 SDK
1818

1919
Steps:
2020
1. Download the source code, and create a new user/database in PostGreSQL for FasTnT ;

src/FasTnT.Data.PostgreSql/Capture/EpcisRequestStore.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,14 @@ public async Task Capture(EpcisRequest request, RequestContext context, Cancella
3838
transaction.Commit();
3939
}
4040

41-
private async Task<int> StoreHeader(EpcisRequest request, User user, IDbTransaction transaction, CancellationToken cancellationToken)
41+
private static async Task<int> StoreHeader(EpcisRequest request, User user, IDbTransaction transaction, CancellationToken cancellationToken)
4242
{
4343
var requestDto = RequestDto.Create(request, user.Id);
4444

4545
return await transaction.InsertAsync(requestDto, cancellationToken);
4646
}
4747

48-
private async Task StoreStandardBusinessHeader(StandardBusinessHeader header, int requestId, IDbTransaction transaction, CancellationToken cancellationToken)
48+
private static async Task StoreStandardBusinessHeader(StandardBusinessHeader header, int requestId, IDbTransaction transaction, CancellationToken cancellationToken)
4949
{
5050
if (header == default) return;
5151

@@ -79,7 +79,7 @@ private static async Task StoreEpcisEvents(List<EpcisEvent> events, int requestI
7979
await eventDtoManager.PersistAsync(transaction, cancellationToken);
8080
}
8181

82-
private async Task StoreMasterData(List<EpcisMasterData> epcisMasterDatas, IDbTransaction tx, CancellationToken cancellationToken)
82+
private static async Task StoreMasterData(List<EpcisMasterData> epcisMasterDatas, IDbTransaction tx, CancellationToken cancellationToken)
8383
{
8484
if (epcisMasterDatas.Count == 0) return;
8585

src/FasTnT.Data.PostgreSql/Capture/SubscriptionManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public async Task Store(Subscription subscription, CancellationToken cancellatio
2727
var parameterValues = new List<ParameterValueDto>();
2828

2929
using var transaction = _connection.BeginTransaction();
30-
var subscriptionId = await transaction.InsertAsync(SubscriptionDto.Create(subscription));
30+
var subscriptionId = await transaction.InsertAsync(SubscriptionDto.Create(subscription), cancellationToken);
3131

3232
for(short id=0; id<subscription.Parameters.Count; id++)
3333
{

src/FasTnT.Data.PostgreSql/DapperConfiguration/EventDtoManager.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,11 @@ internal IEnumerable<EpcisEvent> FormatEvents()
7676
return Events.Select(evt =>
7777
{
7878
var epcisEvent = evt.ToEpcisEvent();
79-
epcisEvent.Epcs = Epcs.Where(x => x.Matches(evt)).Select(x => x.ToEpc()).ToList();
80-
epcisEvent.CustomFields = CreateHierarchy(CustomFields.Where(x => x.Matches(evt)));
81-
epcisEvent.BusinessTransactions = Transactions.Where(x => x.Matches(evt)).Select(x => x.ToBusinessTransaction()).ToList();
82-
epcisEvent.SourceDestinationList = SourceDests.Where(x => x.Matches(evt)).Select(x => x.ToSourceDestination()).ToList();
83-
epcisEvent.CorrectiveEventIds = CorrectiveIds.Where(x => x.Matches(evt)).Select(x => x.ToCorrectiveId()).ToList();
79+
epcisEvent.Epcs.AddRange(Epcs.Where(x => x.Matches(evt)).Select(x => x.ToEpc()));
80+
epcisEvent.CustomFields.AddRange(CreateHierarchy(CustomFields.Where(x => x.Matches(evt))));
81+
epcisEvent.BusinessTransactions.AddRange(Transactions.Where(x => x.Matches(evt)).Select(x => x.ToBusinessTransaction()));
82+
epcisEvent.SourceDestinationList.AddRange(SourceDests.Where(x => x.Matches(evt)).Select(x => x.ToSourceDestination()));
83+
epcisEvent.CorrectiveEventIds.AddRange(CorrectiveIds.Where(x => x.Matches(evt)).Select(x => x.ToCorrectiveId()));
8484

8585
return epcisEvent;
8686
});

src/FasTnT.Data.PostgreSql/FasTnT.Data.PostgreSql.csproj

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFramework>netcoreapp3.1</TargetFramework>
4-
<LangVersion>8</LangVersion>
3+
<TargetFramework>net5.0</TargetFramework>
4+
<LangVersion>9</LangVersion>
55
</PropertyGroup>
66
<ItemGroup>
77
<None Remove="Migrations\Initial\M008_SubscriptionTrigger.sql" />
@@ -36,12 +36,12 @@
3636
<EmbeddedResource Include="Migrations\Initial\M008_SubscriptionTrigger.sql" />
3737
</ItemGroup>
3838
<ItemGroup>
39-
<PackageReference Include="Dapper" Version="2.0.35" />
40-
<PackageReference Include="Dapper.SqlBuilder" Version="2.0.35" />
41-
<PackageReference Include="dbup-postgresql" Version="4.4.0" />
39+
<PackageReference Include="Dapper" Version="2.0.78" />
40+
<PackageReference Include="Dapper.SqlBuilder" Version="2.0.78" />
41+
<PackageReference Include="dbup-postgresql" Version="4.5.0" />
4242
<PackageReference Include="Faithlife.Utility.Dapper" Version="1.1.0" />
4343
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="5.0.0" />
44-
<PackageReference Include="Npgsql" Version="4.1.5" />
44+
<PackageReference Include="Npgsql" Version="5.0.0" />
4545
</ItemGroup>
4646
<ItemGroup>
4747
<ProjectReference Include="..\FasTnT.Domain\FasTnT.Domain.csproj" />

src/FasTnT.Data.PostgreSql/Query/QueryParameters.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public string Add<T>(T value)
1717
: throw new Exception("Impossible to create SQL parameter.");
1818
}
1919

20-
private object GetSqlValue<T>(T value)
20+
private static object GetSqlValue<T>(T value)
2121
{
2222
return value switch
2323
{

src/FasTnT.Domain/Constants.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ namespace FasTnT.Domain
44
{
55
public static class Constants
66
{
7-
public static string VendorVersion = "2.1.3";
8-
public static string StandardVersion = "1.2";
7+
public static string VendorVersion => Assembly.GetName().Version.ToString(3);
8+
public static string StandardVersion => "1.2";
99

10-
public static Assembly Assembly = typeof(Constants).Assembly;
10+
public static readonly Assembly Assembly = typeof(Constants).Assembly;
1111
}
1212
}

src/FasTnT.Domain/FasTnT.Domain.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>netcoreapp3.1</TargetFramework>
5-
<LangVersion>8</LangVersion>
4+
<TargetFramework>net5.0</TargetFramework>
5+
<LangVersion>9</LangVersion>
66
</PropertyGroup>
77

88
<ItemGroup>
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
using FasTnT.Commands.Responses;
2+
using FasTnT.Domain;
3+
using FasTnT.Domain.Data;
4+
using FasTnT.Model.Enums;
5+
using FasTnT.Model.Events;
6+
using FasTnT.Model.Exceptions;
7+
using MediatR;
8+
using System.Linq;
9+
using System.Threading;
10+
using System.Threading.Tasks;
11+
12+
namespace FasTnT.Commands.Requests
13+
{
14+
public class CaptureEpcisDocumentHandler : IRequestHandler<CaptureEpcisDocumentRequest, IEpcisResponse>
15+
{
16+
private readonly RequestContext _context;
17+
private readonly IEpcisRequestStore _documentStore;
18+
19+
public CaptureEpcisDocumentHandler(RequestContext context, IEpcisRequestStore documentStore)
20+
{
21+
_context = context;
22+
_documentStore = documentStore;
23+
}
24+
25+
public async Task<IEpcisResponse> Handle(CaptureEpcisDocumentRequest request, CancellationToken cancellationToken)
26+
{
27+
request.Request.EventList.ForEach(Validate);
28+
29+
await _documentStore.Capture(request.Request, _context, cancellationToken);
30+
31+
return EmptyResponse.Value;
32+
}
33+
34+
internal static void Validate(EpcisEvent evt)
35+
{
36+
if (IsAddOrDeleteAggregation(evt) && !evt.Epcs.Any(x => x.Type == EpcType.ParentId)) // TCR-7 parentID is Populated for ADD or DELETE Actions in Aggregation Events
37+
{
38+
throw new EpcisException(ExceptionType.ValidationException, "TCR-7: parentID must be populated for ADD or DELETE aggregation event.");
39+
}
40+
}
41+
42+
private static bool IsAddOrDeleteAggregation(EpcisEvent evt) => evt.Type == EventType.Aggregation && new[] { EventAction.Add, EventAction.Delete }.Contains(evt.Action);
43+
}
44+
}
Lines changed: 2 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,10 @@
1-
using FasTnT.Commands.Responses;
2-
using FasTnT.Domain;
3-
using FasTnT.Domain.Commands;
4-
using FasTnT.Domain.Data;
1+
using FasTnT.Domain.Commands;
52
using FasTnT.Model;
6-
using FasTnT.Model.Enums;
7-
using FasTnT.Model.Events;
8-
using FasTnT.Model.Exceptions;
9-
using MediatR;
10-
using System.Linq;
11-
using System.Threading;
12-
using System.Threading.Tasks;
133

144
namespace FasTnT.Commands.Requests
155
{
166
public class CaptureEpcisDocumentRequest : ICaptureRequest
177
{
18-
public EpcisRequest Request { get; set; }
19-
20-
public class CaptureEpcisDocumentHandler : IRequestHandler<CaptureEpcisDocumentRequest, IEpcisResponse>
21-
{
22-
private readonly RequestContext _context;
23-
private readonly IEpcisRequestStore _documentStore;
24-
25-
public CaptureEpcisDocumentHandler(RequestContext context, IEpcisRequestStore documentStore)
26-
{
27-
_context = context;
28-
_documentStore = documentStore;
29-
}
30-
31-
public async Task<IEpcisResponse> Handle(CaptureEpcisDocumentRequest request, CancellationToken cancellationToken)
32-
{
33-
request.Request.EventList.ForEach(Validate);
34-
35-
await _documentStore.Capture(request.Request, _context, cancellationToken);
36-
37-
return EmptyResponse.Value;
38-
}
39-
40-
internal static void Validate(EpcisEvent evt)
41-
{
42-
foreach(var epc in evt.Epcs)
43-
{
44-
UriValidator.Validate(epc.Id);
45-
}
46-
47-
if (IsAddOrDeleteAggregation(evt) && !evt.Epcs.Any(x => x.Type == EpcType.ParentId)) // TCR-7 parentID is Populated for ADD or DELETE Actions in Aggregation Events
48-
{
49-
throw new EpcisException(ExceptionType.ValidationException, "TCR-7: parentID must be populated for ADD or DELETE aggregation event.");
50-
}
51-
}
52-
53-
private static bool IsAddOrDeleteAggregation(EpcisEvent evt) => evt.Type == EventType.Aggregation && new[] { EventAction.Add, EventAction.Delete }.Contains(evt.Action);
54-
}
8+
public EpcisRequest Request { get; init; }
559
}
5610
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
using FasTnT.Commands.Responses;
2+
using FasTnT.Domain.Queries;
3+
using MediatR;
4+
using System.Collections.Generic;
5+
using System.Linq;
6+
using System.Threading;
7+
using System.Threading.Tasks;
8+
9+
namespace FasTnT.Commands.Requests
10+
{
11+
public class GetQueryNamesHandler : IRequestHandler<GetQueryNamesRequest, IEpcisResponse>
12+
{
13+
private readonly IEnumerable<IEpcisQuery> _queries;
14+
15+
public GetQueryNamesHandler(IEnumerable<IEpcisQuery> queries)
16+
{
17+
_queries = queries;
18+
}
19+
20+
public async Task<IEpcisResponse> Handle(GetQueryNamesRequest request, CancellationToken cancellationToken)
21+
{
22+
return await Task.FromResult(new GetQueryNamesResponse
23+
{
24+
QueryNames = _queries.Select(q => q.Name).ToArray()
25+
});
26+
}
27+
}
28+
}
Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,8 @@
1-
using FasTnT.Commands.Responses;
2-
using FasTnT.Domain.Commands;
3-
using FasTnT.Domain.Queries;
4-
using MediatR;
5-
using System.Collections.Generic;
6-
using System.Linq;
7-
using System.Threading;
8-
using System.Threading.Tasks;
1+
using FasTnT.Domain.Commands;
92

103
namespace FasTnT.Commands.Requests
114
{
125
public class GetQueryNamesRequest : IQueryRequest
136
{
14-
public class GetQueryNamesHandler : IRequestHandler<GetQueryNamesRequest, IEpcisResponse>
15-
{
16-
private readonly IEnumerable<IEpcisQuery> _queries;
17-
18-
public GetQueryNamesHandler(IEnumerable<IEpcisQuery> queries)
19-
{
20-
_queries = queries;
21-
}
22-
23-
public async Task<IEpcisResponse> Handle(GetQueryNamesRequest request, CancellationToken cancellationToken)
24-
{
25-
return await Task.FromResult(new GetQueryNamesResponse
26-
{
27-
QueryNames = _queries.Select(q => q.Name).ToArray()
28-
});
29-
}
30-
}
317
}
328
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
using FasTnT.Commands.Responses;
2+
using FasTnT.Domain;
3+
using MediatR;
4+
using System.Threading;
5+
using System.Threading.Tasks;
6+
7+
namespace FasTnT.Commands.Requests
8+
{
9+
public class GetStandardVersionHandler : IRequestHandler<GetStandardVersionRequest, IEpcisResponse>
10+
{
11+
public async Task<IEpcisResponse> Handle(GetStandardVersionRequest request, CancellationToken cancellationToken)
12+
{
13+
var result = new GetStandardVersionResponse { Version = Constants.StandardVersion };
14+
15+
return await Task.FromResult(result);
16+
}
17+
}
18+
}
Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,8 @@
1-
using FasTnT.Commands.Responses;
2-
using FasTnT.Domain;
3-
using FasTnT.Domain.Commands;
4-
using MediatR;
5-
using System.Threading;
6-
using System.Threading.Tasks;
1+
using FasTnT.Domain.Commands;
72

83
namespace FasTnT.Commands.Requests
94
{
105
public class GetStandardVersionRequest : IQueryRequest
116
{
12-
public class GetStandardVersionHandler : IRequestHandler<GetStandardVersionRequest, IEpcisResponse>
13-
{
14-
public async Task<IEpcisResponse> Handle(GetStandardVersionRequest request, CancellationToken cancellationToken)
15-
{
16-
var result = new GetStandardVersionResponse { Version = Constants.StandardVersion };
17-
18-
return await Task.FromResult(result);
19-
}
20-
}
217
}
228
}

0 commit comments

Comments
 (0)