KamiSama.Modules.Locations.Core 10.0.14

dotnet add package KamiSama.Modules.Locations.Core --version 10.0.14
                    
NuGet\Install-Package KamiSama.Modules.Locations.Core -Version 10.0.14
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="KamiSama.Modules.Locations.Core" Version="10.0.14" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="KamiSama.Modules.Locations.Core" Version="10.0.14" />
                    
Directory.Packages.props
<PackageReference Include="KamiSama.Modules.Locations.Core" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add KamiSama.Modules.Locations.Core --version 10.0.14
                    
#r "nuget: KamiSama.Modules.Locations.Core, 10.0.14"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package KamiSama.Modules.Locations.Core@10.0.14
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=KamiSama.Modules.Locations.Core&version=10.0.14
                    
Install as a Cake Addin
#tool nuget:?package=KamiSama.Modules.Locations.Core&version=10.0.14
                    
Install as a Cake Tool

KamiSama.Modules.Locations.Core

Back to package index

Version: 10.0.0

Description

ASP.NET Core Locations implementation with EF Core province and city persistence, scoped feature services, modular registration, and startup database initialization. Install it with at least the selected PostgreSQL or SQLite provider and complete setup through the extended builder.

How to use

dotnet add package KamiSama.Modules.Locations.Core --version 10.0.0

Publication mismatch: 10.0.0 in the required install command is the current workspace/root documentation version. NuGet exposed 10.0.11 as the latest package when this surface was reviewed; 10.0.0 itself was not available.

Install Core plus at least the selected provider package. Configure one provider key and connection string, pass a callback that registers that key, and finish through BuildAsync before resolving or using Locations features:

{
  "Locations": {
    "initialization": {
      "migrate": true,
      "initialize": false,
      "test-data": false
    },
    "database": {
      "provider": "postgresql",
      "connection-string": "Host=localhost;Database=locations;Username=app;Password=..."
    }
  }
}
using KamiSama.Modules;
using KamiSama.Modules.Locations;

var webBuilder = WebApplication.CreateBuilder(args);
IConfigurationSection locations = webBuilder.Configuration.GetSection("Locations");

ExtendedWebApplicationBuilder builder = webBuilder.Extend()
    .AddLocationsModule(
        locations,
        locations.GetSection("database"),
        database => database.AddPostgresqlLocationsDbContext());

WebApplication app = await builder.BuildAsync(CancellationToken.None);

The callback receives IMultiProviderDbContextBuilder<LocationsDbContext>. Use AddPostgresqlLocationsDbContext for configured key postgresql or AddSqliteLocationsDbContext for sqlite; keys are lowercased before resolution. A callback may register both installed providers, but configuration selects exactly one keyed context for a running host. The nullable callback is mandatory in a normal setup: without a matching keyed registration, post-build context resolution fails.

BuildAsync first runs module service registration, then builds the app, then initializes Locations. Initialization options are read from Locations:initialization under the named Locations options instance. The default fallback initializer runs EF migrations only when migrate is true; its initialize and test-data stages are no-ops. A registered IDatabaseInitializer<LocationsDbContext> can implement those seed stages. Migration therefore happens during startup and requires database connectivity, schema privileges, and a provider package containing compatible migrations.

Core discovers scoped feature and repository implementations and adds memory caching, but it maps no controllers or endpoints. Inject abstraction interfaces after build. Adds and updates do not perform duplicate-name checks. Adding or moving a city requires an existing province and otherwise throws NotFoundException<Province>. Province deletion is restricted by the relationship and can fail at save time while cities reference it. Repository mutations save immediately; list/find queries are tracked, and provider registrations enable lazy-loading proxies.

City name and province-name filters call ToLower().Contains(...) in the translated database query; matching and index use therefore depend on provider translation and collation. City order token province sorts by province then city, all other values sort by city, and province ordering always uses name. IListCitiesByProvinceName starts from CitySearchModel.All, so it returns all matching rows in a page-shaped result rather than applying a finite page. City represents its parent through a required Province navigation and exposes no separate public ProvinceId property.

Namespaces

Types

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on KamiSama.Modules.Locations.Core:

Package Downloads
KamiSama.Modules.Locations.Postgresql

PostgreSQL EF Core context and provider registration for KamiSama.Modules.Locations.Core, including Locations migrations and keyed context resolution.

KamiSama.Modules.Locations.Sqlite

SQLite EF Core context and provider registration for KamiSama.Modules.Locations.Core, including Locations migrations and keyed context resolution.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
10.0.14 44 11/8/2026
10.0.13.1 109 10/22/2026
10.0.13 112 10/22/2026
10.0.11.9 164 8/24/2026
10.0.11.8 155 8/22/2026
10.0.11.7 147 8/21/2026
10.0.11.6 148 8/19/2026
10.0.11.5 141 8/18/2026
10.0.11.4 147 8/18/2026
10.0.11.3 138 8/18/2026
10.0.11.2 156 8/18/2026
10.0.11.1 152 8/15/2026
10.0.11 159 8/11/2026
10.0.10.2 143 8/4/2026