Skip to content

Commit

Permalink
Template fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
chullybun committed Mar 29, 2024
1 parent 1f3414c commit b9eb851
Show file tree
Hide file tree
Showing 40 changed files with 99 additions and 101 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

Represents the **NuGet** versions.

## v5.12.2
- *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.
- *Fixed:* The API Agent templates have been updated to account for the changes to the `TypedHttpClientBase` constructor signature in `CoreEx` (`v3.15.0`).
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.1</Version>
<Version>5.12.2</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.15.0" />
<PackageReference Include="CoreEx.AspNetCore" Version="3.16.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.15.0" />
<PackageReference Include="CoreEx.Cosmos" Version="3.15.0" />
<PackageReference Include="CoreEx.Validation" Version="3.15.0" />
<PackageReference Include="CoreEx.AspNetCore" Version="3.16.0" />
<PackageReference Include="CoreEx.Cosmos" Version="3.16.0" />
<PackageReference Include="CoreEx.Validation" Version="3.16.0" />
</ItemGroup>
</Project>
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.15.0" />
<PackageReference Include="CoreEx" Version="3.16.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.15.0" />
<PackageReference Include="CoreEx.UnitTesting.NUnit" Version="3.16.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.15.0" />
<PackageReference Include="CoreEx.AspNetCore" Version="3.16.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 @@ -15,14 +15,14 @@
</ItemGroup>

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Beef.Demo.Business.Validation
{
public class RobotValidator : AbstractValidator<Robot>
public class RobotValidator : FluentValidation.AbstractValidator<Robot>
{
public RobotValidator()
{
Expand Down
2 changes: 1 addition & 1 deletion samples/Demo/Beef.Demo.Common/Beef.Demo.Common.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<Folder Include="Agents\" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="CoreEx" Version="3.15.0" />
<PackageReference Include="CoreEx" Version="3.16.0" />
<PackageReference Include="Grpc.Tools" Version="2.62.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down
4 changes: 2 additions & 2 deletions samples/Demo/Beef.Demo.Test/Beef.Demo.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="CoreEx.UnitTesting" Version="3.15.0" />
<PackageReference Include="CoreEx.UnitTesting" Version="3.16.0" />
<PackageReference Include="NUnit.Analyzers" Version="4.1.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand All @@ -62,7 +62,7 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="UnitTestEx.NUnit" Version="4.3.0" />
<PackageReference Include="UnitTestEx.NUnit" Version="4.3.1" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion samples/My.Hr/My.Hr.Api/My.Hr.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.15.0" />
<PackageReference Include="CoreEx.AspNetCore" Version="3.16.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" />
<PackageReference Include="Swashbuckle.AspNetCore.Newtonsoft" Version="6.5.0" />
</ItemGroup>
Expand Down
8 changes: 4 additions & 4 deletions samples/My.Hr/My.Hr.Business/My.Hr.Business.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
<ImplicitUsings>true</ImplicitUsings>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="CoreEx" Version="3.15.0" />
<PackageReference Include="CoreEx.Database.SqlServer" Version="3.15.0" />
<PackageReference Include="CoreEx.EntityFrameworkCore" Version="3.15.0" />
<PackageReference Include="CoreEx.Validation" Version="3.15.0" />
<PackageReference Include="CoreEx" Version="3.16.0" />
<PackageReference Include="CoreEx.Database.SqlServer" Version="3.16.0" />
<PackageReference Include="CoreEx.EntityFrameworkCore" Version="3.16.0" />
<PackageReference Include="CoreEx.Validation" Version="3.16.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.20" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion samples/My.Hr/My.Hr.Common/My.Hr.Common.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="CoreEx" Version="3.15.0" />
<PackageReference Include="CoreEx" Version="3.16.0" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion samples/My.Hr/My.Hr.Database/My.Hr.Database.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="8.0.0" />
<PackageReference Include="Microsoft.Tye.Extensions.Configuration" Version="0.10.0-alpha.21420.1" />
</ItemGroup>

Expand Down
4 changes: 2 additions & 2 deletions samples/My.Hr/My.Hr.Test/My.Hr.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="CoreEx" Version="3.15.0" />
<PackageReference Include="CoreEx" Version="3.16.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand All @@ -42,7 +42,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.15.0" />
<PackageReference Include="CoreEx.UnitTesting.NUnit" Version="3.16.0" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions samples/MyEf.Hr/MyEf.Hr.Api/MyEf.Hr.Api.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<GenerateDocumentationFile>True</GenerateDocumentationFile>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="CoreEx.AspNetCore" Version="3.15.0" />
<PackageReference Include="CoreEx.Azure" Version="3.15.0" />
<PackageReference Include="CoreEx.AspNetCore" Version="3.16.0" />
<PackageReference Include="CoreEx.Azure" Version="3.16.0" />
<PackageReference Include="OpenTelemetry.Instrumentation.EntityFrameworkCore" Version="1.0.0-beta.9" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" />
<PackageReference Include="Azure.Monitor.OpenTelemetry.AspNetCore" Version="1.1.0" />
Expand Down
10 changes: 5 additions & 5 deletions samples/MyEf.Hr/MyEf.Hr.Business/MyEf.Hr.Business.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
<ImplicitUsings>true</ImplicitUsings>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="CoreEx" Version="3.15.0" />
<PackageReference Include="CoreEx.Database.SqlServer" Version="3.15.0" />
<PackageReference Include="CoreEx.EntityFrameworkCore" Version="3.15.0" />
<PackageReference Include="CoreEx.Validation" Version="3.15.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.1" />
<PackageReference Include="CoreEx" Version="3.16.0" />
<PackageReference Include="CoreEx.Database.SqlServer" Version="3.16.0" />
<PackageReference Include="CoreEx.EntityFrameworkCore" Version="3.16.0" />
<PackageReference Include="CoreEx.Validation" Version="3.16.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.3" />
</ItemGroup>
<ItemGroup>
<Folder Include="Data\EfModel\Generated\" />
Expand Down
2 changes: 1 addition & 1 deletion samples/MyEf.Hr/MyEf.Hr.Common/MyEf.Hr.Common.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="CoreEx" Version="3.15.0" />
<PackageReference Include="CoreEx" Version="3.16.0" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@
</Content>
</ItemGroup>
<ItemGroup>
<PackageReference Include="CoreEx.Azure" Version="3.15.0" />
<PackageReference Include="CoreEx.Validation" Version="3.15.0" />
<PackageReference Include="CoreEx.Azure" Version="3.16.0" />
<PackageReference Include="CoreEx.Validation" Version="3.16.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker" Version="1.21.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.ServiceBus" Version="5.17.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Sdk" Version="1.17.2" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.ApplicationInsights" Version="1.2.0" />
<PackageReference Include="Microsoft.ApplicationInsights.WorkerService" Version="2.22.0" />
<PackageReference Include="Microsoft.Extensions.Http.Polly" Version="8.0.2" />
<PackageReference Include="Microsoft.Extensions.Http.Polly" Version="8.0.3" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\MyEf.Hr.Common\MyEf.Hr.Common.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="CoreEx.UnitTesting.NUnit" Version="3.15.0" />
<PackageReference Include="CoreEx.UnitTesting.NUnit" Version="3.16.0" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions samples/MyEf.Hr/MyEf.Hr.Test/MyEf.Hr.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="CoreEx" Version="3.15.0" />
<PackageReference Include="CoreEx" Version="3.16.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand All @@ -42,7 +42,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.15.0" />
<PackageReference Include="CoreEx.UnitTesting.NUnit" Version="3.16.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,15 @@
"type": "generated",
"generator": "constant",
"parameters": {
"value": "3.15.0"
"value": "3.16.0"
},
"replaces": "CoreExVersion"
},
"beef_version": {
"type": "generated",
"generator": "constant",
"parameters": {
"value": "5.12.1"
"value": "5.12.2"
},
"replaces": "BeefVersion"
},
Expand Down Expand Up @@ -172,7 +172,7 @@
"modifiers": [
{
"condition": "(implement_none)",
"exclude": [ "Company.AppName.Business/Validation/**/*", "Company.AppName.Business/Data/PersonData.cs" ]
"exclude": [ "Company.AppName.Business/Validation/**/*", "Company.AppName.Business/Data/PersonData.cs", "Company.AppName.Test/Apis/PersonTest.cs", "Company.AppName.Test/Resources/*", "Company.AppName.Test/Validators/*" ]
},
{
"condition": "(implement_cosmos || implement_httpagent || implement_none)",
Expand Down Expand Up @@ -208,7 +208,7 @@
},
{
"condition": "!(implement_services)",
"exclude": [ "Company.AppName.Services/**/*", "Company.AppName.ServicesTest/**/*" ]
"exclude": [ "Company.AppName.Services/**/*", "Company.AppName.Services.Test/**/*" ]
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,16 @@ public void ConfigureServices(IServiceCollection services)
services.AddControllers();

// Add health checks.
services.AddHealthChecks();
services.AddHealthChecks()
#if (implement_services)
#if (implement_database || implement_sqlserver)
.AddEventPublisherHealthCheck("ServiceBus", sp => new EventPublisher(sp.GetRequiredService<EventDataFormatter>(), sp.GetRequiredService<IEventSerializer>(), sp.GetRequiredService<IServiceBusSender>()));
#else
.AddEventPublisherHealthCheck("EventSender", sp => new EventPublisher(sp.GetRequiredService<EventDataFormatter>(), sp.GetRequiredService<IEventSerializer>(), sp.GetRequiredService<IEventSender>()));
#endif
#else
.AddEventPublisherHealthCheck("EventSender", sp => new EventPublisher(sp.GetRequiredService<EventDataFormatter>(), sp.GetRequiredService<IEventSerializer>(), sp.GetRequiredService<IEventSender>()));
#endif

// Add Azure monitor open telemetry.
services.AddOpenTelemetry().UseAzureMonitor().WithTracing(b => b.AddSource("CoreEx.*", "MyEf.Hr.*", "Microsoft.EntityFrameworkCore.*", "EntityFrameworkCore.*"));
Expand Down Expand Up @@ -140,7 +149,7 @@ public void Configure(IApplicationBuilder app)

// Add health checks.
app.UseHealthChecks("/health");
app.UseHealthChecks("/health/detail"); // Secure with permissions / or remove given data returned.
app.UseHealthChecks("/health/detailed", new HealthCheckOptions { ResponseWriter = HealthReportStatusWriter.WriteJsonResults }); // Secure with permissions / or remove given data returned.

// Use controllers.
app.UseRouting();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
// Set using environment variable: 'AppName_ConnectionStrings__Database'
"ConnectionStrings": {
//#if (implement_services)
"ServiceBus": "Endpoint=sb://top-secret.servicebus.windows.net/;SharedAccessKeyName=top-secret;SharedAccessKey=top-encrypted-secret;",
"Storage": "DefaultEndpointsProtocol=https;AccountName=top-secret;AccountKey=top-secret;EndpointSuffix=core.windows.net",
"ServiceBus": "Endpoint=sb://top-secret.servicebus.windows.net/;SharedAccessKeyName=top-secret;SharedAccessKey=top-encrypted-secret;EntityPath=event-stream",
"Storage": "UseDevelopmentStorage=true;",
//#endif
"Database": "Data Source=.;Initial Catalog=Company.AppName;Integrated Security=True;TrustServerCertificate=true"
},
Expand All @@ -19,7 +19,7 @@
// Set using environment variable: 'AppName_ConnectionStrings__Database'
"ConnectionStrings": {
//#if (implement_services)
"ServiceBus": "Endpoint=sb://top-secret.servicebus.windows.net/;SharedAccessKeyName=top-secret;SharedAccessKey=top-encrypted-secret;",
"ServiceBus": "Endpoint=sb://top-secret.servicebus.windows.net/;SharedAccessKeyName=top-secret;SharedAccessKey=top-encrypted-secret;EntityPath=event-stream",
//#endif
"Database": "Server=localhost; Port=3306; Database=Company.AppName; Uid=dbuser; Pwd=dbpassword; AllowUserVariables=true; UseAffectedRows=false"
},
Expand All @@ -28,7 +28,7 @@
// Set using environment variable: 'AppName_ConnectionStrings__Database'
"ConnectionStrings": {
//#if (implement_services)
"ServiceBus": "Endpoint=sb://top-secret.servicebus.windows.net/;SharedAccessKeyName=top-secret;SharedAccessKey=top-encrypted-secret;",
"ServiceBus": "Endpoint=sb://top-secret.servicebus.windows.net/;SharedAccessKeyName=top-secret;SharedAccessKey=top-encrypted-secret;EntityPath=event-stream",
//#endif
"Database": "Server=localhost; Database=Company.AppName; Username=postgres; Password=dbpassword;"
},
Expand All @@ -54,5 +54,6 @@
"Default": {
"TracingEnabled": true
}
}
},
"IncludeExceptionInResult": true
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ public class AppNameSettings(IConfiguration configuration) : SettingsBase(config
/// Gets the Azure Service Bus connection string.
/// </summary>
public string ServiceBusConnectionString => GetRequiredValue<string>("ConnectionStrings__ServiceBus");

/// <summary>
/// Gets the Azure Service Bus queue or topic name for the sender.
/// </summary>
public string ServiceBusQueueOrTopicName => GetRequiredValue<string>("ServiceBusSender__QueueOrTopicName");
#if (implement_database || implement_sqlserver)

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
<!--#endif -->
<PackageReference Include="CoreEx.Validation" Version="CoreExVersion" />
<!--#if (implement_sqlserver) -->
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.3" />
<!--#endif -->
<!--#if (implement_mysql) -->
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="8.0.0-beta.2" />
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="8.0.2" />
<!--#endif -->
<!--#if (implement_postgres) -->
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="8.0.2" />
Expand Down
Loading

0 comments on commit b9eb851

Please sign in to comment.