Skip to content

Commit

Permalink
Use Reference
Browse files Browse the repository at this point in the history
  • Loading branch information
ajcvickers committed May 10, 2023
1 parent edb3073 commit 5bbc55a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/EFCore.Design/Design/Internal/CSharpHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -926,7 +926,7 @@ public virtual string Literal(Enum value, bool fullName = false)
return name == null
? type.IsDefined(typeof(FlagsAttribute), false)
? GetCompositeEnumValue(type, value, fullName)
: $"({type.DisplayName(fullName: true, compilable: true)}){UnknownLiteral(Convert.ChangeType(value, Enum.GetUnderlyingType(type)))}"
: $"({Reference(type)}){UnknownLiteral(Convert.ChangeType(value, Enum.GetUnderlyingType(type)))}"
: GetSimpleEnumValue(type, name, fullName);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1803,7 +1803,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType? ba
typeof(CSharpRuntimeModelCodeGeneratorTest.AnEnum),
propertyInfo: typeof(CSharpRuntimeModelCodeGeneratorTest.PrincipalBase).GetProperty("Enum1", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly),
fieldInfo: typeof(CSharpRuntimeModelCodeGeneratorTest.PrincipalBase).GetField("<Enum1>k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly),
sentinel: (Microsoft.EntityFrameworkCore.Scaffolding.Internal.CSharpRuntimeModelCodeGeneratorTest.AnEnum)0);
sentinel: (CSharpRuntimeModelCodeGeneratorTest.AnEnum)0);
enum1.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None);

var enum2 = runtimeEntityType.AddProperty(
Expand Down Expand Up @@ -3570,7 +3570,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType? ba
typeof(CSharpRuntimeModelCodeGeneratorTest.AnEnum),
propertyInfo: typeof(CSharpRuntimeModelCodeGeneratorTest.PrincipalBase).GetProperty("Enum1", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly),
fieldInfo: typeof(CSharpRuntimeModelCodeGeneratorTest.PrincipalBase).GetField("<Enum1>k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly),
sentinel: (Microsoft.EntityFrameworkCore.Scaffolding.Internal.CSharpRuntimeModelCodeGeneratorTest.AnEnum)0);
sentinel: (CSharpRuntimeModelCodeGeneratorTest.AnEnum)0);
enum1.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None);

var enum2 = runtimeEntityType.AddProperty(
Expand Down Expand Up @@ -5483,7 +5483,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType? ba
typeof(CSharpRuntimeModelCodeGeneratorTest.AnEnum),
propertyInfo: typeof(CSharpRuntimeModelCodeGeneratorTest.PrincipalBase).GetProperty("Enum1", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly),
fieldInfo: typeof(CSharpRuntimeModelCodeGeneratorTest.PrincipalBase).GetField("<Enum1>k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly),
sentinel: (Microsoft.EntityFrameworkCore.Scaffolding.Internal.CSharpRuntimeModelCodeGeneratorTest.AnEnum)0);
sentinel: (CSharpRuntimeModelCodeGeneratorTest.AnEnum)0);
enum1.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None);

var enum2 = runtimeEntityType.AddProperty(
Expand Down

0 comments on commit 5bbc55a

Please sign in to comment.