Skip to content
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
5 changes: 3 additions & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -499,5 +499,6 @@ dotnet_naming_rule.parameters_rule.severity = warning

# Custom config for addressdata project
[*.cs]
# Disable (ignore) CA1848 entirely
dotnet_diagnostic.CA1848.severity = none
# TODO: Disabled warnings about logging. Feel free to re-enable them if you believe these warnings are valid.
dotnet_diagnostic.CA1848.severity = none
dotnet_diagnostic.CA1873.severity = none
2 changes: 1 addition & 1 deletion .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.x
dotnet-version: 10.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2025 Ashton Abdiukov
Copyright (c) 2025-2026 Ashton Abdiukov

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
13 changes: 6 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,17 @@ Currently, [AddressData.net](https://AddressData.net) contains millions of addre
### Using Visual Studio

#### Requirements
- Visual Studio 2022
- Visual Studio 2026
- With ASP.NET and web development installed from the Visual Studio Installer
- .NET 8 SDK
- Any Operating System
- .NET 10 SDK

#### How to Run
1. Open the solution in Visual Studio 2022.
1. Open the solution in Visual Studio 2026.
2. Build and launch the AddressData.WebApi project.
3. The API can be accessed at [https://localhost:5280](https://localhost:5280).

#### How to Test
1. Open the solution in Visual Studio 2022.
1. Open the solution in Visual Studio 2026.
2. Run the tests in Test Explorer.

## Usage
Expand All @@ -50,9 +49,9 @@ Currently, [AddressData.net](https://AddressData.net) contains millions of addre
- Navigate to [https://localhost:5280](https://localhost:5280).
- Make a `POST` request to the `/documents/seed` endpoint.
3. **Monitor Output**:
- After a while, youll see a newly created folder structure (in your solutions output directory) containing country and city CSV files with addresses.
- After a while, you'll see a newly created folder structure (in your solution's output directory) containing country and city CSV files with addresses.
- Note that the *full* seeding process can take up to **1 day** to complete, depending on how many records you are collecting.
- If youre in a hurry, you can provide a **limit** parameter in your POST request to `/documents/seed` to only generate a smaller subset of data.
- If you're in a hurry, you can provide a **limit** parameter in your POST request to `/documents/seed` to only generate a smaller subset of data.

## Acknowledgments

Expand Down
4 changes: 2 additions & 2 deletions src/AddressData.Core/AddressData.Core.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
Expand All @@ -11,7 +11,7 @@

<ItemGroup>
<PackageReference Include="CsvHelper" Version="33.1.0" />
<PackageReference Include="Microsoft.Extensions.Http" Version="9.0.9" />
<PackageReference Include="Microsoft.Extensions.Http" Version="10.0.1" />
</ItemGroup>

</Project>
1 change: 1 addition & 0 deletions src/AddressData.Core/Services/SeedingService.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
namespace AddressData.Core.Services;

using Interfaces;
using Mappers;
using Microsoft.Extensions.Logging;
Expand Down Expand Up @@ -54,7 +55,7 @@
var result = new List<AddressDocumentDomainModel>();
var allCities = await overpassTurboService.GetCities();

logger.LogInformation("Running seeding. All cities count: {Count}", allCities.Count());

Check warning on line 58 in src/AddressData.Core/Services/SeedingService.cs

View workflow job for this annotation

GitHub Actions / build

Possible null reference argument for parameter 'source' in 'int Enumerable.Count<CityInfoDomainModel>(IEnumerable<CityInfoDomainModel> source)'.

foreach (var city in allCities)
{
Expand Down
16 changes: 8 additions & 8 deletions src/AddressData.WebApi/AddressData.WebApi.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
Expand All @@ -10,14 +10,14 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Http.Polly" Version="9.0.9" />
<PackageReference Include="Microsoft.Extensions.Http.Polly" Version="10.0.1" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.22.1" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="9.0.4" />
<PackageReference Include="Swashbuckle.AspNetCore.Filters" Version="9.0.0" />
<PackageReference Include="OpenTelemetry.Exporter.Console" Version="1.12.0" />
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.12.0" />
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.12.0" />
<PackageReference Include="OpenTelemetry.Instrumentation.Http" Version="1.12.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="10.1.0" />
<PackageReference Include="Swashbuckle.AspNetCore.Filters" Version="10.0.1" />
<PackageReference Include="OpenTelemetry.Exporter.Console" 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.Http" Version="1.14.0" />
</ItemGroup>


Expand Down
2 changes: 1 addition & 1 deletion src/AddressData.WebApi/Dependency/ServiceRegistrations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ namespace AddressData.WebApi.Dependency;
using Core.Services;
using Core.Services.Interfaces;
using Microsoft.AspNetCore.Server.Kestrel.Core;
using Microsoft.OpenApi.Models;
using Microsoft.OpenApi;
using OpenTelemetry.Resources;
using OpenTelemetry.Trace;
using Polly;
Expand Down
7 changes: 4 additions & 3 deletions src/AddressData.WebApi/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
# See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging.

# This stage is used when running from VS in fast mode (Default for Debug configuration)
FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS base
FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS base
USER $APP_UID
WORKDIR /app
EXPOSE 8080
EXPOSE 8081


# This stage is used to build the service project
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
ARG BUILD_CONFIGURATION=Release
WORKDIR /src
COPY ["src/AddressData.WebApi/AddressData.WebApi.csproj", "src/AddressData.WebApi/"]
Expand All @@ -27,4 +28,4 @@ RUN dotnet publish "./AddressData.WebApi.csproj" -c $BUILD_CONFIGURATION -o /app
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "AddressData.WebApi.dll"]
ENTRYPOINT ["dotnet", "AddressData.WebApi.dll"]
1 change: 1 addition & 0 deletions src/AddressData.WebApi/Program.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
namespace AddressData.WebApi;

using Core;
using Dependency;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<RootNamespace>AddressData.FunctionalTests</RootNamespace>
Expand All @@ -13,13 +13,13 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="9.0.9" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="10.0.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.22.1" />
<PackageReference Include="Reqnroll.NUnit" Version="3.0.2" />
<PackageReference Include="RestSharp" Version="112.1.0" />
<PackageReference Include="Reqnroll.NUnit" Version="3.3.0" />
<PackageReference Include="RestSharp" Version="113.0.0" />
<PackageReference Include="nunit" Version="4.4.0" />
<PackageReference Include="NUnit3TestAdapter" Version="5.1.0" />
<PackageReference Include="NUnit3TestAdapter" Version="6.0.1" />
</ItemGroup>


Expand Down
8 changes: 4 additions & 4 deletions tests/AddressData.UnitTests/AddressData.UnitTests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
Expand All @@ -11,11 +11,11 @@

<ItemGroup>
<PackageReference Include="AutoFixture" Version="4.18.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />
<PackageReference Include="Moq" Version="4.20.72" />
<PackageReference Include="NUnit" Version="4.4.0" />
<PackageReference Include="NUnit3TestAdapter" Version="5.1.0" />
<PackageReference Include="NUnit.Analyzers" Version="4.10.0">
<PackageReference Include="NUnit3TestAdapter" Version="6.0.1" />
<PackageReference Include="NUnit.Analyzers" Version="4.11.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
namespace AddressData.UnitTests.Services;

using AddressData.Core.Models.Domain;
using AddressData.Core.Services;
using NUnit.Framework;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
namespace AddressData.UnitTests.Services;

using AddressData.Core.Services;
using AddressData.UnitTests.Helpers;
using Microsoft.Extensions.Logging;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
namespace AddressData.UnitTests.Services;

using System.Collections;
using System.ComponentModel.DataAnnotations;
using AddressData.Core.Models.Domain;
Expand Down
Loading