LaotiSok.ModelBuilder.NamingCaseToSpecificCase
1.0.3
dotnet add package LaotiSok.ModelBuilder.NamingCaseToSpecificCase --version 1.0.3
NuGet\Install-Package LaotiSok.ModelBuilder.NamingCaseToSpecificCase -Version 1.0.3
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="LaotiSok.ModelBuilder.NamingCaseToSpecificCase" Version="1.0.3" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add LaotiSok.ModelBuilder.NamingCaseToSpecificCase --version 1.0.3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: LaotiSok.ModelBuilder.NamingCaseToSpecificCase, 1.0.3"
#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.
// Install LaotiSok.ModelBuilder.NamingCaseToSpecificCase as a Cake Addin #addin nuget:?package=LaotiSok.ModelBuilder.NamingCaseToSpecificCase&version=1.0.3 // Install LaotiSok.ModelBuilder.NamingCaseToSpecificCase as a Cake Tool #tool nuget:?package=LaotiSok.ModelBuilder.NamingCaseToSpecificCase&version=1.0.3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
ModelBuilder Case Conversion (Object Relational Mapping)
Quick Access
Overview
This extension is ensure when working with different naming conventions in different systems, such as PascalCase in ASP.NET Core and snake_case in PostgreSQL, it is generally a good practice to ensure consistency and clarity in your codebase. Converting PascalCase to snake_case when configuring your entity mappings in the OnModelCreating method of DbContext can help maintain this consistency.
Feature
Extension | Description |
---|---|
NamingToUpperCase |
Convert ORM Naming to upper case |
NamingToLowerCase |
Convert ORM Naming to lower case |
NamingToCamelCase |
Convert ORM Naming to camel case |
NamingToSnakeCase |
Convert ORM Naming to snake case |
NamingToPascalCase |
Convert ORM Naming to pascal case |
Configuration
Update your prefer DataContext.cs
on function OnModelCreating
// Mapping pascal case to snake case
modelBuilder.NamingToSnakeCase();
Example
Using in DataContext class that you prefer
using ModelBuilderNamingCase.ToSpecificCase;
public class SampleDbContext : DbContext
{
public SampleDbContext(DbContextOptions<DemoDataContext> options) : base(options) { }
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
// Mapping pascal case to snake case
modelBuilder.NamingToSnakeCase();
}
}
Buy me a coffee
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net6.0
- GraphQL.Client (>= 6.0.5)
- Microsoft.EntityFrameworkCore.Relational (>= 6.0.0)
-
net7.0
- GraphQL.Client (>= 6.0.5)
- Microsoft.EntityFrameworkCore.Relational (>= 7.0.0)
-
net8.0
- GraphQL.Client (>= 6.0.5)
- Microsoft.EntityFrameworkCore.Relational (>= 8.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.0.3 | 87 | 6/6/2024 |
1.0.2 | 84 | 6/6/2024 |
1.0.1 | 121 | 5/2/2024 |
1.0.0 | 89 | 4/30/2024 |
1.0.0-alpha.5 | 49 | 4/29/2024 |
1.0.0-alpha.4 | 47 | 4/29/2024 |
1.0.0-alpha.3 | 46 | 4/29/2024 |
1.0.0-alpha.2 | 45 | 4/29/2024 |
1.0.0-alpha.1 | 47 | 4/29/2024 |