Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
a66a810
add classes (models and enum)
tsda04 Oct 30, 2025
d3f6302
added data seeder and fixture
tsda04 Oct 31, 2025
53b25ca
change the type of id from guid to int, added tests and github action
tsda04 Oct 31, 2025
c8836bd
fixed dotnet-tests.yml
tsda04 Oct 31, 2025
7805b4e
fixed dotnet-tests.yml 2
tsda04 Oct 31, 2025
e2b3998
fixed dotnet-tests.yml - 3
tsda04 Oct 31, 2025
9b7be37
delete "<OutputType>Exe</OutputType>" in BikeRental.Domain.csproj
tsda04 Oct 31, 2025
14ac949
added summary in tests
tsda04 Oct 31, 2025
2f034bd
delete Exe from BikeRental.Tests
tsda04 Oct 31, 2025
54600ad
Update README.md
tsda04 Nov 1, 2025
c1c431d
Update README.md
tsda04 Nov 1, 2025
4002caa
change type RentPrice
tsda04 Nov 1, 2025
43566fe
replaced field with property
tsda04 Nov 1, 2025
aa502c8
moved the Id to the top of the class
tsda04 Nov 1, 2025
c2418d3
made methods static
tsda04 Nov 1, 2025
233f25f
fixed tests and data for tests
tsda04 Nov 13, 2025
ac5681c
changed BikeRental.Tests.csproj to run the test
tsda04 Nov 14, 2025
6e27866
added PR trigger to test workflow
tsda04 Nov 14, 2025
294c609
created the project structure
tsda04 Dec 9, 2025
cfd5bf5
created dto
tsda04 Dec 9, 2025
74f55af
created service interfaces
tsda04 Dec 9, 2025
34548e8
cleaned directories
tsda04 Dec 9, 2025
faadb4b
created IRepository, changed .csproj
tsda04 Dec 14, 2025
28c1c11
added core infrastructure and application services, several changes i…
tsda04 Dec 17, 2025
083bef5
add API controllers with CRUD endpoints
tsda04 Dec 18, 2025
4c24cb8
add error handling and dependency injection: GlobalExceptionHandler m…
tsda04 Dec 18, 2025
f98896c
Update project structure
tsda04 Dec 18, 2025
ff7ec1b
add initial EF Core migration
tsda04 Dec 18, 2025
5aa70a5
implemented data seeding service and extensions, added appsettings an…
tsda04 Dec 18, 2025
b4cd94f
updated the Lease model, improved the infrastructure, and added sourc…
tsda04 Dec 18, 2025
9c14f8b
upd README.md for lab 2 and 3
tsda04 Dec 18, 2025
feb10bb
small fixes, cleaned up code
tsda04 Dec 19, 2025
990ee44
cleanded code
tsda04 Dec 21, 2025
d3cc69a
cleanup in Infrastructure only, minor changes in .csproj, Repositories
tsda04 Dec 21, 2025
1f52fcb
returned useful comments
tsda04 Dec 21, 2025
bac5a49
added logging to the global exception handler and fixed exception out…
tsda04 Dec 22, 2025
17cbdb3
removed useless ConfigureAwait(false)
tsda04 Dec 22, 2025
edbecf8
added validation attributes to all DTOs for creation/deletion
tsda04 Dec 22, 2025
35f41e9
replaced unused variables, marked static, used primary constructor, p…
tsda04 Dec 23, 2025
e184a9e
started 4 labs: structure, possible elements
tsda04 Dec 24, 2025
a2b8e6c
added simple generator
tsda04 Dec 24, 2025
9c91fd3
added connection to NATS, generator, and worker
tsda04 Dec 24, 2025
03c9cec
added consumer - first worked try
tsda04 Dec 24, 2025
edbde52
made better structure
tsda04 Dec 24, 2025
488ccbe
added Bogus to the generator
tsda04 Dec 25, 2025
983475d
made GetAll sorted
tsda04 Dec 25, 2025
11cdaa3
updated README.md
tsda04 Dec 25, 2025
dce1348
replaced CancellationToken, simplified collection initialization, cle…
tsda04 Dec 26, 2025
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
23 changes: 12 additions & 11 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ csharp_style_var_for_built_in_types = true:error
csharp_style_var_when_type_is_apparent = true:error
csharp_style_var_elsewhere = false:silent
csharp_space_around_binary_operators = before_and_after

[*.{cs,vb}]
#### Naming styles ####

Expand All @@ -64,31 +65,31 @@ dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case

dotnet_naming_symbols.interface.applicable_kinds = interface
dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
dotnet_naming_symbols.interface.required_modifiers =
dotnet_naming_symbols.interface.required_modifiers =

dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum
dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
dotnet_naming_symbols.types.required_modifiers =
dotnet_naming_symbols.types.required_modifiers =

dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method
dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
dotnet_naming_symbols.non_field_members.required_modifiers =
dotnet_naming_symbols.non_field_members.required_modifiers =

# Naming styles

dotnet_naming_style.begins_with_i.required_prefix = I
dotnet_naming_style.begins_with_i.required_suffix =
dotnet_naming_style.begins_with_i.word_separator =
dotnet_naming_style.begins_with_i.required_suffix =
dotnet_naming_style.begins_with_i.word_separator =
dotnet_naming_style.begins_with_i.capitalization = pascal_case

dotnet_naming_style.pascal_case.required_prefix =
dotnet_naming_style.pascal_case.required_suffix =
dotnet_naming_style.pascal_case.word_separator =
dotnet_naming_style.pascal_case.required_prefix =
dotnet_naming_style.pascal_case.required_suffix =
dotnet_naming_style.pascal_case.word_separator =
dotnet_naming_style.pascal_case.capitalization = pascal_case

dotnet_naming_style.pascal_case.required_prefix =
dotnet_naming_style.pascal_case.required_suffix =
dotnet_naming_style.pascal_case.word_separator =
dotnet_naming_style.pascal_case.required_prefix =
dotnet_naming_style.pascal_case.required_suffix =
dotnet_naming_style.pascal_case.word_separator =
dotnet_naming_style.pascal_case.capitalization = pascal_case
dotnet_style_operator_placement_when_wrapping = beginning_of_line
tab_width = 4
Expand Down
29 changes: 29 additions & 0 deletions .github/workflows/dotnet-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: dotnet-tests.yml
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
test:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x

- name: Restore dependencies
run: dotnet restore BikeRental/BikeRental.sln

- name: Build
run: dotnet build --no-restore --configuration Release BikeRental/BikeRental.sln

- name: Run tests
run: dotnet test BikeRental/BikeRental.Tests/BikeRental.Tests.csproj --no-build --configuration Release


13 changes: 13 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/indexLayout.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions BikeRental/.idea/.idea.BikeRental/.idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions BikeRental/.idea/.idea.BikeRental/.idea/indexLayout.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions BikeRental/.idea/.idea.BikeRental/.idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 30 additions & 0 deletions BikeRental/AppHost/AppHost.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<Project Sdk="Microsoft.NET.Sdk">

<Sdk Name="Aspire.AppHost.Sdk" Version="13.0.2"/>

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<UserSecretsId>fa0efc8b-9978-4cb9-83d3-bbcd25eab020</UserSecretsId>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Aspire.Hosting.AppHost" Version="13.0.2"/>
<PackageReference Include="Aspire.Hosting.MySql" Version="13.0.2"/>
<PackageReference Include="CommunityToolkit.Aspire.Hosting.MySql.Extensions" Version="13.0.1-beta.468"/>
</ItemGroup>

<ItemGroup>
<None Update="appsettings.Development.json">
<DependentUpon>appsettings.json</DependentUpon>
</None>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\BikeRental.Api\BikeRental.Api.csproj"/>
<ProjectReference Include="..\BikeRental.Generator.Nats.Host\BikeRental.Generator.Nats.Host.csproj"/>
</ItemGroup>

</Project>
35 changes: 35 additions & 0 deletions BikeRental/AppHost/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
using Projects;

IDistributedApplicationBuilder builder = DistributedApplication.CreateBuilder(args);

IResourceBuilder<ContainerResource> nats = builder.AddContainer("nats", "nats:2.10")
.WithArgs("-js")
.WithEndpoint(4222, 4222);

IResourceBuilder<ParameterResource> bikeRentalDbPassword = builder.AddParameter(
"bike-rental-db-password",
"1234512345Aa$",
secret: true);
IResourceBuilder<MySqlServerResource> bikeRentalSql = builder.AddMySql("bike-rental-db",
bikeRentalDbPassword)
.WithAdminer()
.WithDataVolume("bike-rental-volume");

IResourceBuilder<MySqlDatabaseResource> bikeRentalDb =
bikeRentalSql.AddDatabase("bike-rental");

builder.AddProject<BikeRental_Generator_Nats_Host>("bike-rental-nats-generator")
.WaitFor(nats)
.WithEnvironment("Nats__Url", "nats://localhost:4222")
.WithEnvironment("Nats__StreamName", "bike-rental-stream")
.WithEnvironment("Nats__SubjectName", "bike-rental.leases");

builder.AddProject<BikeRental_Api>("bike-rental-api")
.WaitFor(bikeRentalDb)
.WaitFor(nats)
.WithReference(bikeRentalDb)
.WithEnvironment("Nats__Url", "nats://localhost:4222")
.WithEnvironment("Nats__StreamName", "bike-rental-stream")
.WithEnvironment("Nats__SubjectName", "bike-rental.leases");

builder.Build().Run();
31 changes: 31 additions & 0 deletions BikeRental/AppHost/Properties/launchSettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"$schema": "https://json.schemastore.org/launchsettings.json",
"profiles": {
"https": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"applicationUrl": "https://localhost:17195;http://localhost:15246",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development",
"DOTNET_ENVIRONMENT": "Development",
"ASPIRE_DASHBOARD_OTLP_ENDPOINT_URL": "https://localhost:21053",
"ASPIRE_RESOURCE_SERVICE_ENDPOINT_URL": "https://localhost:22270",
"DOTNET_DASHBOARD_UNSECURED_ALLOW_ANONYMOUS": "true"
}
},
"http": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"applicationUrl": "http://localhost:15246",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development",
"DOTNET_ENVIRONMENT": "Development",
"ASPIRE_DASHBOARD_OTLP_ENDPOINT_URL": "http://localhost:19196",
"ASPIRE_RESOURCE_SERVICE_ENDPOINT_URL": "http://localhost:20132",
"DOTNET_DASHBOARD_UNSECURED_ALLOW_ANONYMOUS": "true"
}
}
}
}
8 changes: 8 additions & 0 deletions BikeRental/AppHost/appsettings.Development.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
}
}
9 changes: 9 additions & 0 deletions BikeRental/AppHost/appsettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning",
"Aspire.Hosting.Dcp": "Warning"
}
}
}
57 changes: 57 additions & 0 deletions BikeRental/BikeRental.Api/BikeRental.Api.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
<DocumentationFile>bin\Debug\net8.0\BikeRental.Api.xml</DocumentationFile>
<DockerfileContext>..\..</DockerfileContext>
</PropertyGroup>

<ItemGroup>
<Folder Include="Controllers\"/>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\BikeRental.Application\BikeRental.Application.csproj"/>
<ProjectReference Include="..\BikeRental.Infrastructure\BikeRental.Infrastructure.csproj"/>
</ItemGroup>

<ItemGroup>

<PackageReference Include="EFCore.NamingConventions" Version="8.0.3"/>
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="8.0.22"/>
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="8.0.22"/>
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.22">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.22">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.23.0"/>
<PackageReference Include="MySql.Data.OpenTelemetry" Version="8.4.0"/>
<PackageReference Include="MySql.EntityFrameworkCore" Version="8.0.20"/>
<PackageReference Include="NATS.Client.Core" Version="2.7.0"/>
<PackageReference Include="NATS.Client.JetStream" Version="2.7.0"/>
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.14.0"/>
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.14.0"/>
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.14.0"/>
<PackageReference Include="OpenTelemetry.Instrumentation.EntityFrameworkCore" Version="1.14.0-beta.2"/>
<PackageReference Include="OpenTelemetry.Instrumentation.Http" Version="1.14.0"/>
<PackageReference Include="OpenTelemetry.Instrumentation.Runtime" Version="1.14.0"/>
<PackageReference Include="Swashbuckle.AspNetCore" Version="8.1.4"/>
<PackageReference Include="Swashbuckle.AspNetCore.Annotations" Version="8.1.4"/>
<PackageReference Include="Swashbuckle.AspNetCore.Filters" Version="8.0.3"/>
</ItemGroup>

<ItemGroup>
<Content Update="appsettings.Development.json">
<DependentUpon>appsettings.json</DependentUpon>
</Content>
</ItemGroup>


</Project>
Loading