Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v5.12.4 #242

Merged
merged 1 commit into from
Apr 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,16 @@

Represents the **NuGet** versions.

## v5.12.4
- *Fixed:* Fixes to the `Template` solution to improve the initial `dotnet new beef` experience, including sample Reference Data API tests.
- *Fixed:* Upgraded `CoreEx` (`v3.18.0`) to include all related fixes and improvements.
- *Fixed:* The `EntityManager_cs.hbs` template has been updated to account for the `CoreEx.Validation.ValueValidator<T>` fixes.

## v5.12.3
- *Fixed:* Fixes to the Template solution to improve the initial `dotnet new beef` experience with respect to API health endpoint.
- *Fixed:* Fixes to the `Template` solution to improve the initial `dotnet new beef` experience with respect to API health endpoint.

## v5.12.2
- *Fixed:* Fixes to the Template solution to improve the initial `dotnet new beef` experience.
- *Fixed:* Fixes to the `Template` solution to improve the initial `dotnet new beef` experience.

## v5.12.1
- *Fixed:* Upgraded `CoreEx` (`v3.15.0`) to include all related fixes and improvements.
Expand All @@ -25,7 +30,7 @@ Represents the **NuGet** versions.
## v5.10.0
- *Enhancement:* Added [PostgreSQL](https://www.postgresql.org/) database support:
- Leverages both `CoreEx.Database.Postgres` (runtime) and `DbEx.Postgres` (migration) packages; encapsulates the `Npgsql` package.
- The `Npgsql.EntityFrameworkCore.PostgreSQL` packages is used for the entity framework provider.
- The `Npgsql.EntityFrameworkCore.PostgreSQL` package is used for the entity framework provider.
- The `dotnet new beef` template updated to support new `datasource` option of `postgres`.
- *Enhancement:* Additional improvements for data migration and code-generation, including `SqlServer` and `MySql`, as a result of `DbEx` (`v2.5.0`) enhancements.

Expand Down
2 changes: 1 addition & 1 deletion Common.targets
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<Version>5.12.3</Version>
<Version>5.12.4</Version>
<LangVersion>preview</LangVersion>
<Authors>Avanade</Authors>
<Company>Avanade</Company>
Expand Down
2 changes: 1 addition & 1 deletion samples/Cdr.Banking/Cdr.Banking.Api/Cdr.Banking.Api.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<ImplicitUsings>true</ImplicitUsings>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="CoreEx.AspNetCore" Version="3.17.0" />
<PackageReference Include="CoreEx.AspNetCore" Version="3.18.0" />
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerGen" Version="6.5.0" />
</ItemGroup>
<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
<Folder Include="DataSvc\" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="CoreEx.AspNetCore" Version="3.17.0" />
<PackageReference Include="CoreEx.Cosmos" Version="3.17.0" />
<PackageReference Include="CoreEx.Validation" Version="3.17.0" />
<PackageReference Include="CoreEx.AspNetCore" Version="3.18.0" />
<PackageReference Include="CoreEx.Cosmos" Version="3.18.0" />
<PackageReference Include="CoreEx.Validation" Version="3.18.0" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public AccountManager(IAccountDataSvc dataService)
public Task<Result<AccountCollectionResult>> GetAccountsAsync(AccountArgs? args, PagingArgs? paging) => ManagerInvoker.Current.InvokeAsync(this, (_, ct) =>
{
return Result.Go()
.ValidatesAsync(args, v => v.Entity().With<AccountArgsValidator>(), cancellationToken: ct)
.ValidatesAsync(args, vc => vc.Entity().With<AccountArgsValidator>(), cancellationToken: ct)
.ThenAsAsync(() => _dataService.GetAccountsAsync(args, paging));
}, InvokerArgs.Read);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ public TransactionManager(ITransactionDataSvc dataService)
{
return Result.Go().Requires(accountId)
.ValidateAsync(() => MultiValidator.Create()
.Add(accountId.Validate().Common(Validators.AccountId))
.Add(args.Validate().Entity().With<TransactionArgsValidator>()))
.Add(accountId.Validate().Configure(vc => vc.Common(Validators.AccountId)))
.Add(args.Validate().Configure(vc => vc.Entity().With<TransactionArgsValidator>())), cancellationToken: ct)
.ThenAsAsync(() => _dataService.GetTransactionsAsync(accountId, args, paging));
}, InvokerArgs.Read);
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ public static class Validators
/// <summary>
/// Validates an <see cref="Account.Id"/> value to ensure that the executing user is authorized to access.
/// </summary>
public static CommonValidator<string?> AccountId => CommonValidator.Create<string?>(v => v.Custom(ctx
public static CommonValidator<string> AccountId => CommonValidator.Create<string>(v => v.Custom(ctx
=> Result.Go().When(() => ctx.Value == null || !ExecutionContext.Current.Accounts.Contains(ctx.Value), () => Result.AuthorizationError())));
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
<Folder Include="Entities\" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="CoreEx" Version="3.17.0" />
<PackageReference Include="CoreEx" Version="3.18.0" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="CoreEx.UnitTesting.NUnit" Version="3.17.0" />
<PackageReference Include="CoreEx.UnitTesting.NUnit" Version="3.18.0" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion samples/Demo/Beef.Demo.Api/Beef.Demo.Api.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="CoreEx.AspNetCore" Version="3.17.0" />
<PackageReference Include="CoreEx.AspNetCore" Version="3.18.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" />
<PackageReference Include="Swashbuckle.AspNetCore.Newtonsoft" Version="6.5.0" />
</ItemGroup>
Expand Down
16 changes: 8 additions & 8 deletions samples/Demo/Beef.Demo.Business/Beef.Demo.Business.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="CoreEx" Version="3.17.0" />
<PackageReference Include="CoreEx.AspNetCore" Version="3.17.0" />
<PackageReference Include="CoreEx.Cosmos" Version="3.17.0" />
<PackageReference Include="CoreEx.Database" Version="3.17.0" />
<PackageReference Include="CoreEx.Database.SqlServer" Version="3.17.0" />
<PackageReference Include="CoreEx.EntityFrameworkCore" Version="3.17.0" />
<PackageReference Include="CoreEx.Validation" Version="3.17.0" />
<PackageReference Include="CoreEx.FluentValidation" Version="3.17.0" />
<PackageReference Include="CoreEx" Version="3.18.0" />
<PackageReference Include="CoreEx.AspNetCore" Version="3.18.0" />
<PackageReference Include="CoreEx.Cosmos" Version="3.18.0" />
<PackageReference Include="CoreEx.Database" Version="3.18.0" />
<PackageReference Include="CoreEx.Database.SqlServer" Version="3.18.0" />
<PackageReference Include="CoreEx.EntityFrameworkCore" Version="3.18.0" />
<PackageReference Include="CoreEx.Validation" Version="3.18.0" />
<PackageReference Include="CoreEx.FluentValidation" Version="3.18.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.20" />
</ItemGroup>

Expand Down
10 changes: 5 additions & 5 deletions samples/Demo/Beef.Demo.Business/Generated/ContactManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ public ContactManager(IContactDataSvc dataService)
/// <inheritdoc/>
public Task<Contact?> GetAsync(Guid id) => ManagerInvoker.Current.InvokeAsync(this, async (_, ct) =>
{
await id.Validate().Mandatory().ValidateAsync(true).ConfigureAwait(false);
await id.Validate().Configure(vc => vc.Mandatory()).ValidateAsync(true).ConfigureAwait(false);
return await _dataService.GetAsync(id).ConfigureAwait(false);
}, InvokerArgs.Read);

/// <inheritdoc/>
public Task<Contact> CreateAsync(Contact value) => ManagerInvoker.Current.InvokeAsync(this, async (_, ct) =>
{
await value.Validate().Mandatory().Entity().With<ContactValidator>().ValidateAsync(true).ConfigureAwait(false);
await value.Validate().Configure(vc => vc.Mandatory().Entity().With<ContactValidator>()).ValidateAsync(true).ConfigureAwait(false);
return await _dataService.CreateAsync(value).ConfigureAwait(false);
}, InvokerArgs.Create);

Expand All @@ -48,8 +48,8 @@ public ContactManager(IContactDataSvc dataService)
{
value.Required().Id = id;
await MultiValidator.Create()
.Add(id.Validate().Mandatory())
.Add(value.Validate().Mandatory().Entity().With<ContactValidator>())
.Add(id.Validate().Configure(vc => vc.Mandatory()))
.Add(value.Validate().Configure(vc => vc.Mandatory().Entity().With<ContactValidator>()))
.ValidateAsync(true).ConfigureAwait(false);

return await _dataService.UpdateAsync(value).ConfigureAwait(false);
Expand All @@ -58,7 +58,7 @@ await MultiValidator.Create()
/// <inheritdoc/>
public Task DeleteAsync(Guid id) => ManagerInvoker.Current.InvokeAsync(this, async (_, ct) =>
{
await id.Validate().Mandatory().ValidateAsync(true).ConfigureAwait(false);
await id.Validate().Configure(vc => vc.Mandatory()).ValidateAsync(true).ConfigureAwait(false);
await _dataService.DeleteAsync(id).ConfigureAwait(false);
}, InvokerArgs.Delete);

Expand Down
50 changes: 25 additions & 25 deletions samples/Demo/Beef.Demo.Business/Generated/PersonManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ public PersonManager(IPersonDataSvc dataService, IIdentifierGenerator identifier
Cleaner.CleanUp(value);
await Invoker.InvokeAsync(_createOnPreValidateAsync?.Invoke(value)).ConfigureAwait(false);
await MultiValidator.Create()
.Add(value.Validate().Mandatory().Entity().With<PersonValidator>())
.Add(value.Validate().Configure(vc => vc.Mandatory().Entity().With<PersonValidator>()))
.Additional(mv => _createOnValidate?.Invoke(mv, value))
.ValidateAsync(true).ConfigureAwait(false);

Expand All @@ -192,7 +192,7 @@ await MultiValidator.Create()
Cleaner.CleanUp(id);
await Invoker.InvokeAsync(_deleteOnPreValidateAsync?.Invoke(id)).ConfigureAwait(false);
await MultiValidator.Create()
.Add(id.Validate().Mandatory())
.Add(id.Validate().Configure(vc => vc.Mandatory()))
.Additional(mv => _deleteOnValidate?.Invoke(mv, id))
.ValidateAsync(true).ConfigureAwait(false);

Expand All @@ -206,7 +206,7 @@ await MultiValidator.Create()
{
Cleaner.CleanUp(id);
await MultiValidator.Create()
.Add(id.Validate().Mandatory())
.Add(id.Validate().Configure(vc => vc.Mandatory()))
.ValidateAsync(true).ConfigureAwait(false);

return Cleaner.Clean(await _dataService.GetAsync(id).ConfigureAwait(false));
Expand All @@ -218,7 +218,7 @@ await MultiValidator.Create()
Cleaner.CleanUp(id);
await Invoker.InvokeAsync(_getExOnPreValidateAsync?.Invoke(id)).ConfigureAwait(false);
await MultiValidator.Create()
.Add(id.Validate().Mandatory())
.Add(id.Validate().Configure(vc => vc.Mandatory()))
.Additional(mv => _getExOnValidate?.Invoke(mv, id))
.ValidateAsync(true).ConfigureAwait(false);

Expand All @@ -235,8 +235,8 @@ await MultiValidator.Create()
Cleaner.CleanUp(value);
await Invoker.InvokeAsync(_updateOnPreValidateAsync?.Invoke(value, id)).ConfigureAwait(false);
await MultiValidator.Create()
.Add(id.Validate().Mandatory())
.Add(value.Validate().Mandatory().Entity().With<PersonValidator>())
.Add(id.Validate().Configure(vc => vc.Mandatory()))
.Add(value.Validate().Configure(vc => vc.Mandatory().Entity().With<PersonValidator>()))
.Additional(mv => _updateOnValidate?.Invoke(mv, value, id))
.ValidateAsync(true).ConfigureAwait(false);

Expand All @@ -253,8 +253,8 @@ await MultiValidator.Create()
Cleaner.CleanUp(value);
await Invoker.InvokeAsync(_updateWithRollbackOnPreValidateAsync?.Invoke(value, id)).ConfigureAwait(false);
await MultiValidator.Create()
.Add(id.Validate().Mandatory())
.Add(value.Validate().Mandatory().Entity().With<PersonValidator>())
.Add(id.Validate().Configure(vc => vc.Mandatory()))
.Add(value.Validate().Configure(vc => vc.Mandatory().Entity().With<PersonValidator>()))
.Additional(mv => _updateWithRollbackOnValidate?.Invoke(mv, value, id))
.ValidateAsync(true).ConfigureAwait(false);

Expand Down Expand Up @@ -298,7 +298,7 @@ await MultiValidator.Create()
Cleaner.CleanUp(args);
await Invoker.InvokeAsync(_getByArgsOnPreValidateAsync?.Invoke(args, paging)).ConfigureAwait(false);
await MultiValidator.Create()
.Add(args.Validate().Entity().With<PersonArgsValidator>())
.Add(args.Validate().Configure(vc => vc.Entity().With<PersonArgsValidator>()))
.Additional(mv => _getByArgsOnValidate?.Invoke(mv, args, paging))
.ValidateAsync(true).ConfigureAwait(false);

Expand All @@ -314,7 +314,7 @@ await MultiValidator.Create()
Cleaner.CleanUp(args);
await Invoker.InvokeAsync(_getDetailByArgsOnPreValidateAsync?.Invoke(args, paging)).ConfigureAwait(false);
await MultiValidator.Create()
.Add(args.Validate().Entity().With<PersonArgsValidator>())
.Add(args.Validate().Configure(vc => vc.Entity().With<PersonArgsValidator>()))
.Additional(mv => _getDetailByArgsOnValidate?.Invoke(mv, args, paging))
.ValidateAsync(true).ConfigureAwait(false);

Expand All @@ -330,8 +330,8 @@ await MultiValidator.Create()
Cleaner.CleanUp(fromId, toId);
await Invoker.InvokeAsync(_mergeOnPreValidateAsync?.Invoke(fromId, toId)).ConfigureAwait(false);
await MultiValidator.Create()
.Add(fromId.Validate().Mandatory())
.Add(toId.Validate().Mandatory().CompareValue(CompareOperator.NotEqual, fromId, nameof(fromId).ToSentenceCase()!))
.Add(fromId.Validate().Configure(vc => vc.Mandatory()))
.Add(toId.Validate().Configure(vc => vc.Mandatory().CompareValue(CompareOperator.NotEqual, fromId, nameof(fromId).ToSentenceCase()!)))
.Additional(mv => _mergeOnValidate?.Invoke(mv, fromId, toId))
.ValidateAsync(true).ConfigureAwait(false);

Expand Down Expand Up @@ -389,7 +389,7 @@ await MultiValidator.Create()
Cleaner.CleanUp(id);
await Invoker.InvokeAsync(_getDetailOnPreValidateAsync?.Invoke(id)).ConfigureAwait(false);
await MultiValidator.Create()
.Add(id.Validate().Mandatory())
.Add(id.Validate().Configure(vc => vc.Mandatory()))
.Additional(mv => _getDetailOnValidate?.Invoke(mv, id))
.ValidateAsync(true).ConfigureAwait(false);

Expand All @@ -406,8 +406,8 @@ await MultiValidator.Create()
Cleaner.CleanUp(value);
await Invoker.InvokeAsync(_updateDetailOnPreValidateAsync?.Invoke(value, id)).ConfigureAwait(false);
await MultiValidator.Create()
.Add(id.Validate().Mandatory())
.Add(value.Validate().Mandatory().Entity().With<PersonDetailValidator>())
.Add(id.Validate().Configure(vc => vc.Mandatory()))
.Add(value.Validate().Configure(vc => vc.Mandatory().Entity().With<PersonDetailValidator>()))
.Additional(mv => _updateDetailOnValidate?.Invoke(mv, value, id))
.ValidateAsync(true).ConfigureAwait(false);

Expand Down Expand Up @@ -470,7 +470,7 @@ await MultiValidator.Create()
Cleaner.CleanUp(value.Required());
await Invoker.InvokeAsync(_eventPublishNoSendOnPreValidateAsync?.Invoke(value)).ConfigureAwait(false);
await MultiValidator.Create()
.Add(value.Validate().Mandatory().Entity().With<PersonValidator>())
.Add(value.Validate().Configure(vc => vc.Mandatory().Entity().With<PersonValidator>()))
.Additional(mv => _eventPublishNoSendOnValidate?.Invoke(mv, value))
.ValidateAsync(true).ConfigureAwait(false);

Expand All @@ -486,7 +486,7 @@ await MultiValidator.Create()
Cleaner.CleanUp(args);
await Invoker.InvokeAsync(_getByArgsWithEfOnPreValidateAsync?.Invoke(args, paging)).ConfigureAwait(false);
await MultiValidator.Create()
.Add(args.Validate().Entity().With<PersonArgsValidator>())
.Add(args.Validate().Configure(vc => vc.Entity().With<PersonArgsValidator>()))
.Additional(mv => _getByArgsWithEfOnValidate?.Invoke(mv, args, paging))
.ValidateAsync(true).ConfigureAwait(false);

Expand Down Expand Up @@ -515,7 +515,7 @@ await MultiValidator.Create()
Cleaner.CleanUp(id);
await Invoker.InvokeAsync(_invokeApiViaAgentOnPreValidateAsync?.Invoke(id)).ConfigureAwait(false);
await MultiValidator.Create()
.Add(id.Validate().Mandatory())
.Add(id.Validate().Configure(vc => vc.Mandatory()))
.Additional(mv => _invokeApiViaAgentOnValidate?.Invoke(mv, id))
.ValidateAsync(true).ConfigureAwait(false);

Expand All @@ -531,7 +531,7 @@ await MultiValidator.Create()
Cleaner.CleanUp(addresses);
await Invoker.InvokeAsync(_paramCollOnPreValidateAsync?.Invoke(addresses)).ConfigureAwait(false);
await MultiValidator.Create()
.Add(addresses.Validate().Entity().With<AddressCollectionValidator>())
.Add(addresses.Validate().Configure(vc => vc.Entity().With<AddressCollectionValidator>()))
.Additional(mv => _paramCollOnValidate?.Invoke(mv, addresses))
.ValidateAsync(true).ConfigureAwait(false);

Expand All @@ -546,7 +546,7 @@ await MultiValidator.Create()
Cleaner.CleanUp(id);
await Invoker.InvokeAsync(_getWithEfOnPreValidateAsync?.Invoke(id)).ConfigureAwait(false);
await MultiValidator.Create()
.Add(id.Validate().Mandatory())
.Add(id.Validate().Configure(vc => vc.Mandatory()))
.Additional(mv => _getWithEfOnValidate?.Invoke(mv, id))
.ValidateAsync(true).ConfigureAwait(false);

Expand All @@ -563,7 +563,7 @@ await MultiValidator.Create()
Cleaner.CleanUp(value);
await Invoker.InvokeAsync(_createWithEfOnPreValidateAsync?.Invoke(value)).ConfigureAwait(false);
await MultiValidator.Create()
.Add(value.Validate().Mandatory().Entity().With<PersonValidator>())
.Add(value.Validate().Configure(vc => vc.Mandatory().Entity().With<PersonValidator>()))
.Additional(mv => _createWithEfOnValidate?.Invoke(mv, value))
.ValidateAsync(true).ConfigureAwait(false);

Expand All @@ -580,8 +580,8 @@ await MultiValidator.Create()
Cleaner.CleanUp(value);
await Invoker.InvokeAsync(_updateWithEfOnPreValidateAsync?.Invoke(value, id)).ConfigureAwait(false);
await MultiValidator.Create()
.Add(id.Validate().Mandatory())
.Add(value.Validate().Mandatory().Entity().With<PersonValidator>())
.Add(id.Validate().Configure(vc => vc.Mandatory()))
.Add(value.Validate().Configure(vc => vc.Mandatory().Entity().With<PersonValidator>()))
.Additional(mv => _updateWithEfOnValidate?.Invoke(mv, value, id))
.ValidateAsync(true).ConfigureAwait(false);

Expand All @@ -597,7 +597,7 @@ await MultiValidator.Create()
Cleaner.CleanUp(id);
await Invoker.InvokeAsync(_deleteWithEfOnPreValidateAsync?.Invoke(id)).ConfigureAwait(false);
await MultiValidator.Create()
.Add(id.Validate().Mandatory())
.Add(id.Validate().Configure(vc => vc.Mandatory()))
.Additional(mv => _deleteWithEfOnValidate?.Invoke(mv, id))
.ValidateAsync(true).ConfigureAwait(false);

Expand All @@ -612,7 +612,7 @@ await MultiValidator.Create()
Cleaner.CleanUp(id);
await Invoker.InvokeAsync(_getDocumentationOnPreValidateAsync?.Invoke(id)).ConfigureAwait(false);
await MultiValidator.Create()
.Add(id.Validate().Mandatory())
.Add(id.Validate().Configure(vc => vc.Mandatory()))
.Additional(mv => _getDocumentationOnValidate?.Invoke(mv, id))
.ValidateAsync(true).ConfigureAwait(false);

Expand Down
Loading
Loading