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
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"sdk": {
"version": "3.1.100"
"version": "3.1.201"
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using EntityFrameworkCore.Scaffolding.Handlebars.Helpers;
using Microsoft.EntityFrameworkCore.Design;
using HandlebarsLib = HandlebarsDotNet.Handlebars;
Expand Down Expand Up @@ -82,15 +83,15 @@ protected override IDictionary<string, string> GetPartialTemplates(
var templates = new Dictionary<string, string>
{
{
Constants.DbContextImportTemplate.ToLower(),
Constants.DbContextImportTemplate.ToLower(CultureInfo.InvariantCulture),
importTemplateFile
},
{
Constants.DbContextCtorTemplate.ToLower(),
Constants.DbContextCtorTemplate.ToLower(CultureInfo.InvariantCulture),
ctorTemplateFile
},
{
Constants.DbContextDbSetsTemplate.ToLower(),
Constants.DbContextDbSetsTemplate.ToLower(CultureInfo.InvariantCulture),
propertyTemplateFile
},
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using EntityFrameworkCore.Scaffolding.Handlebars.Helpers;
using Microsoft.EntityFrameworkCore.Design;
using HandlebarsLib = HandlebarsDotNet.Handlebars;
Expand Down Expand Up @@ -82,15 +83,15 @@ protected override IDictionary<string, string> GetPartialTemplates(
var templates = new Dictionary<string, string>
{
{
Constants.EntityTypeCtorTemplate.ToLower(),
Constants.EntityTypeCtorTemplate.ToLower(CultureInfo.InvariantCulture),
ctorTemplateFile
},
{
Constants.EntityTypeImportTemplate.ToLower(),
Constants.EntityTypeImportTemplate.ToLower(CultureInfo.InvariantCulture),
importTemplateFile
},
{
Constants.EntityTypePropertyTemplate.ToLower(),
Constants.EntityTypePropertyTemplate.ToLower(CultureInfo.InvariantCulture),
propertyTemplateFile
},
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.Globalization;
using System.Text;

namespace EntityFrameworkCore.Scaffolding.Handlebars
Expand Down Expand Up @@ -49,7 +50,7 @@ public string ToCamelCase(string s)
return s;
var chars = s.ToCharArray();
var sb = new StringBuilder();
sb.Append(chars[0].ToString().ToLower());
sb.Append(chars[0].ToString().ToLower(CultureInfo.InvariantCulture));
for (int i = 1; i < chars.Length; i++)
{
sb.Append(chars[i]);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Threading;
using EntityFrameworkCore.Scaffolding.Handlebars;
using EntityFrameworkCore.Scaffolding.Handlebars.Helpers;
using HandlebarsDotNet;
Expand Down Expand Up @@ -102,11 +104,14 @@ public HbsCSharpScaffoldingGeneratorTests(NorthwindDbContextFixture fixture)
}

[Theory]
[InlineData(false)]
[InlineData(true)]
public void WriteCode_Should_Generate_Context_File(bool useDataAnnotations)
[InlineData(false, "en-US")]
[InlineData(true, "en-US")]
[InlineData(false, "tr-TR")]
[InlineData(true, "tr-TR")]
public void WriteCode_Should_Generate_Context_File(bool useDataAnnotations, string culture)
{
// Arrange
Thread.CurrentThread.CurrentCulture = new CultureInfo(culture);
var options = ReverseEngineerOptions.DbContextOnly;
var scaffolder = CreateScaffolder(options);

Expand Down Expand Up @@ -137,11 +142,14 @@ public void WriteCode_Should_Generate_Context_File(bool useDataAnnotations)
}

[Theory]
[InlineData(false)]
[InlineData(true)]
public void WriteCode_Should_Generate_Entity_Files(bool useDataAnnotations)
[InlineData(false, "en-US")]
[InlineData(true, "en-US")]
[InlineData(false, "tr-TR")]
[InlineData(true, "tr-TR")]
public void WriteCode_Should_Generate_Entity_Files(bool useDataAnnotations, string culture)
{
// Arrange
Thread.CurrentThread.CurrentCulture = new CultureInfo(culture);
var options = ReverseEngineerOptions.EntitiesOnly;
var scaffolder = CreateScaffolder(options);

Expand Down Expand Up @@ -177,11 +185,14 @@ public void WriteCode_Should_Generate_Entity_Files(bool useDataAnnotations)
}

[Theory]
[InlineData(false)]
[InlineData(true)]
public void WriteCode_Should_Generate_Context_and_Entity_Files(bool useDataAnnotations)
[InlineData(false, "en-US")]
[InlineData(true, "en-US")]
[InlineData(false, "tr-TR")]
[InlineData(true, "tr-TR")]
public void WriteCode_Should_Generate_Context_and_Entity_Files(bool useDataAnnotations, string culture)
{
// Arrange
Thread.CurrentThread.CurrentCulture = new CultureInfo(culture);
var options = ReverseEngineerOptions.DbContextAndEntities;
var scaffolder = CreateScaffolder(options);

Expand Down