Skip to content
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Sdk Name="Aspire.AppHost.Sdk" Version="13.0.2"/>
<Project Sdk="Aspire.AppHost.Sdk/13.1.2">

<PropertyGroup>
<OutputType>Exe</OutputType>
Expand All @@ -10,13 +9,12 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Aspire.Hosting.AppHost" Version="13.0.2"/>
<PackageReference Include="Aspire.Hosting.PostgreSQL" Version="13.0.2"/>
<PackageReference Include="Aspire.Hosting.PostgreSQL" Version="13.1.2" />
<PackageReference Update="SonarAnalyzer.CSharp" Version="10.15.0.120848" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Fitnet\Fitnet.csproj"/>
<ProjectReference Include="..\Fitnet\Fitnet.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ internal void BusinessRules_Should_Not_Have_Dependency_On_Module(string forbidde
.HaveNameEndingWith(forbiddenTypeEnding);

// Act
var validationResult = forbiddenTypes!.Should().NotHaveDependencyOnAny(businessRules).GetResult();
var validationResult = forbiddenTypes.Should().NotHaveDependencyOnAny(businessRules).GetResult();

// Assert
validationResult.FailingTypes.ShouldBeNull();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ internal void Contracts_should_not_have_dependency_on_module(string moduleName)
var rules = contractsModule
.Should()
.NotHaveDependencyOnAny(forbiddenModuleTypes);
var validationResult = rules!.GetResult();
var validationResult = rules.GetResult();

// Assert
validationResult.FailingTypes.ShouldBeNull();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ internal void Offers_should_not_have_dependency_on_module(string moduleName)
var rules = offersModule
.Should()
.NotHaveDependencyOnAny(forbiddenModuleTypes);
var validationResult = rules!.GetResult();
var validationResult = rules.GetResult();

// Assert
validationResult.FailingTypes.ShouldBeNull();
Expand All @@ -49,7 +49,7 @@ public void OffersShouldCommunicateWithPassesViaEvents()
var rules = offersModule
.Should()
.NotHaveDependencyOnAny(forbiddenModuleTypes);
var validationResult = rules!.GetResult();
var validationResult = rules.GetResult();

// Assert
validationResult.FailingTypes.ShouldBeNull();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ internal void Passes_should_not_have_dependency_on_module(string moduleName)
var rules = passesModule
.Should()
.NotHaveDependencyOnAny(forbiddenModuleTypes);
var validationResult = rules!.GetResult();
var validationResult = rules.GetResult();

// Assert
validationResult.FailingTypes.ShouldBeNull();
Expand All @@ -50,7 +50,7 @@ internal void PassesShouldCommunicateWithContractViaEvents()
var rules = passesModule
.Should()
.NotHaveDependencyOnAny(forbiddenModuleTypes);
var validationResult = rules!.GetResult();
var validationResult = rules.GetResult();

// Assert
validationResult.FailingTypes.ShouldBeNull();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ internal void Reports_should_not_have_dependency_on_module(string moduleName)
var rules = reportsModule
.Should()
.NotHaveDependencyOnAny(forbiddenModuleTypes);
var validationResult = rules!.GetResult();
var validationResult = rules.GetResult();

// Assert
validationResult.FailingTypes.ShouldBeNull();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ internal async Task Given_valid_event_published_Then_event_should_be_consumed()
var fakeEvent = FakeEvent.Create();

// Act
await eventBus!.PublishAsync(fakeEvent, CancellationToken.None);
await eventBus.PublishAsync(fakeEvent, CancellationToken.None);

// Assert
fakeEvent.Consumed.ShouldBeTrue();
}

private IEventBus GetEventBus() =>
_applicationInMemory.Services
.CreateScope()!
.CreateScope()
.ServiceProvider
.GetRequiredService<IEventBus>();
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
internal static class ApiDocumentationExtensions
{
internal static void UseApiDocumentation(this IEndpointRouteBuilder app) =>
app.MapGet("/", () => Results.Redirect("/swagger"))
app.MapGet("/", () => Results.Redirect("/docs/v1"))
.WithSummary("Documentation for the API")
.WithDescription("This endpoint is used to redirect to the documentation for the API.")
.Produces(StatusCodes.Status200OK)
Expand Down
2 changes: 1 addition & 1 deletion Chapter-1-initial-architecture/Src/Fitnet/Fitnet.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="10.0.1" />
<PackageReference Include="Microsoft.OpenApi" Version="2.3.0" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="10.0.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="10.0.1" />
<PackageReference Include="Scalar.AspNetCore" Version="2.12.17" />
<PackageReference Update="SonarAnalyzer.CSharp" Version="10.15.0.120848" />
</ItemGroup>

Expand Down
8 changes: 4 additions & 4 deletions Chapter-1-initial-architecture/Src/Fitnet/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
using EvolutionaryArchitecture.Fitnet.Offers;
using EvolutionaryArchitecture.Fitnet.Passes;
using EvolutionaryArchitecture.Fitnet.Reports;
using Scalar.AspNetCore;

var builder = WebApplication.CreateBuilder(args);

builder.Services.AddControllers();
builder.Services.AddExceptionHandling();
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen();
builder.Services.AddOpenApi();
builder.Services.AddEventBus();
builder.Services.AddRequestsValidations();
builder.Services.AddClock();
Expand All @@ -27,8 +27,8 @@

if (app.Environment.IsDevelopment())
{
app.UseSwagger();
app.UseSwaggerUI();
app.MapOpenApi();
app.MapScalarApiReference("/docs/v1");
}

app.UseApiDocumentation();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"launchUrl": "swagger",
"launchUrl": "docs/v1",
"applicationUrl": "http://localhost:5013",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
Expand All @@ -23,19 +23,11 @@
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"launchUrl": "swagger",
"launchUrl": "docs/v1",
"applicationUrl": "https://localhost:7098;http://localhost:5014",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"launchUrl": "swagger",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}
Loading