-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOracleSqlGenerationHelper.cs
More file actions
23 lines (21 loc) · 1.03 KB
/
Copy pathOracleSqlGenerationHelper.cs
File metadata and controls
23 lines (21 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
using Microsoft.EntityFrameworkCore.Storage;
using Oracle.EntityFrameworkCore.Storage.Internal;
using System.Text;
namespace UdemyReact
{
/// <summary>A replacement for <see cref="OracleSqlGenerationHelper"/>
/// to convert PascalCaseCsharpyIdentifiers to all upper casenames.
/// Credit to nachonachoman </summary>
public class OracleSqlGenerationCasingHelper : OracleSqlGenerationHelper
{
//Don't lowercase ef's migration table
const string dontAlter = "__EFMigrationsHistory";
static string Customize(string input) => input == dontAlter ? input : input.ToUpper();
public OracleSqlGenerationCasingHelper(RelationalSqlGenerationHelperDependencies dependencies)
: base(dependencies) { }
public override string DelimitIdentifier(string identifier)
=> base.DelimitIdentifier(Customize(identifier));
public override void DelimitIdentifier(StringBuilder builder, string identifier)
=> base.DelimitIdentifier(builder, Customize(identifier));
}
}