LaotiSok.ModelBuilder.NamingCaseToSpecificCase
1.0.2
See the version list below for details.
dotnet add package LaotiSok.ModelBuilder.NamingCaseToSpecificCase --version 1.0.2
NuGet\Install-Package LaotiSok.ModelBuilder.NamingCaseToSpecificCase -Version 1.0.2
<PackageReference Include="LaotiSok.ModelBuilder.NamingCaseToSpecificCase" Version="1.0.2" />
paket add LaotiSok.ModelBuilder.NamingCaseToSpecificCase --version 1.0.2
#r "nuget: LaotiSok.ModelBuilder.NamingCaseToSpecificCase, 1.0.2"
// Install LaotiSok.ModelBuilder.NamingCaseToSpecificCase as a Cake Addin #addin nuget:?package=LaotiSok.ModelBuilder.NamingCaseToSpecificCase&version=1.0.2 // Install LaotiSok.ModelBuilder.NamingCaseToSpecificCase as a Cake Tool #tool nuget:?package=LaotiSok.ModelBuilder.NamingCaseToSpecificCase&version=1.0.2
<a name="___top"></a> <h1 align="center">🚀 Object Relational Mapping Naming Conversion 🚀</h1> <div align="center">
<img src="https://img.shields.io/badge/Library-.NET Core%20-blue.svg?logo=dotnet" alt="Platform" /> </div>
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. |
-
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 |