Skip to content

Commit

Permalink
Allow underscores in identifiers again
Browse files Browse the repository at this point in the history
Fixes #29450
  • Loading branch information
AndriySvyryd committed Dec 12, 2022
1 parent 1ee1893 commit 4a2118f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
5 changes: 3 additions & 2 deletions src/EFCore.Design/Design/Internal/CSharpHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1510,10 +1510,11 @@ private static bool IsIdentifierPartCharacter(char ch)
{
if (ch < 'a')
{
return ch < 'A'
return (ch < 'A'
? ch >= '0'
&& ch <= '9'
: ch <= 'Z';
: ch <= 'Z')
|| ch == '_';
}

if (ch <= 'z')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2520,12 +2520,12 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType? ba
afterSaveBehavior: PropertySaveBehavior.Throw);
var overrides = new StoreObjectDictionary<RuntimeRelationalPropertyOverrides>();
var idDerivedInsert = new RuntimeRelationalPropertyOverrides(
var idDerived_Insert = new RuntimeRelationalPropertyOverrides(
id,
StoreObjectIdentifier.InsertStoredProcedure(""Derived_Insert"", ""TPC""),
true,
""DerivedId"");
overrides.Add(StoreObjectIdentifier.InsertStoredProcedure(""Derived_Insert"", ""TPC""), idDerivedInsert);
overrides.Add(StoreObjectIdentifier.InsertStoredProcedure(""Derived_Insert"", ""TPC""), idDerived_Insert);
var idPrincipalBaseView = new RuntimeRelationalPropertyOverrides(
id,
StoreObjectIdentifier.View(""PrincipalBaseView"", ""TPC""),
Expand Down Expand Up @@ -4579,23 +4579,23 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas
nullable: true);
blob.AddAnnotation(""Cosmos:PropertyName"", ""JsonBlob"");
var id0 = runtimeEntityType.AddProperty(
var __id = runtimeEntityType.AddProperty(
""__id"",
typeof(string),
afterSaveBehavior: PropertySaveBehavior.Throw,
valueGeneratorFactory: new IdValueGeneratorFactory().Create);
id0.AddAnnotation(""Cosmos:PropertyName"", ""id"");
__id.AddAnnotation(""Cosmos:PropertyName"", ""id"");
var jObject = runtimeEntityType.AddProperty(
var __jObject = runtimeEntityType.AddProperty(
""__jObject"",
typeof(JObject),
nullable: true,
valueGenerated: ValueGenerated.OnAddOrUpdate,
beforeSaveBehavior: PropertySaveBehavior.Ignore,
afterSaveBehavior: PropertySaveBehavior.Ignore);
jObject.AddAnnotation(""Cosmos:PropertyName"", """");
__jObject.AddAnnotation(""Cosmos:PropertyName"", """");
var etag = runtimeEntityType.AddProperty(
var _etag = runtimeEntityType.AddProperty(
""_etag"",
typeof(string),
nullable: true,
Expand All @@ -4609,7 +4609,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas
runtimeEntityType.SetPrimaryKey(key);
var key0 = runtimeEntityType.AddKey(
new[] { id0, partitionId });
new[] { __id, partitionId });
return runtimeEntityType;
}
Expand Down

0 comments on commit 4a2118f

Please sign in to comment.