Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[release/7.0] Allow underscores in identifiers again #29822

Merged
merged 1 commit into from
Jan 4, 2023
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
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 @@ -1455,10 +1455,11 @@ private static bool IsIdentifierPartCharacter(char ch)
{
if (ch < 'a')
{
return ch < 'A'
return (ch < 'A'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

quirk?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's hard to turn on quirks when running tools. Also, it's just reverting to code to what it was before 7.0

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fwiw, I have only had two reports on this in Power Tools

? 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