Skip to content

Commit

Permalink
GetProperties mistake fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielWillett committed Oct 11, 2024
1 parent 31d1dea commit 731ac17
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
11 changes: 4 additions & 7 deletions UncreatedWarfare/Database/EFCompat.cs
Original file line number Diff line number Diff line change
Expand Up @@ -399,16 +399,13 @@ public static IEnumerable<IMutableProperty> GetProperties(IMutableEntityType ent
}

MethodInfo? getProperties = Type.GetType("Microsoft.EntityFrameworkCore.Metadata.IMutableTypeBase, Microsoft.EntityFrameworkCore")?
.GetProperty("GetProperties", BindingFlags.Public | BindingFlags.Instance)?
.GetMethod;

getProperties ??= typeof(IMutableProperty)
.GetProperty("GetProperties", BindingFlags.Public | BindingFlags.Instance)?
.GetMethod;
.GetMethod("GetProperties", BindingFlags.Public | BindingFlags.Instance, null, CallingConventions.Any, Type.EmptyTypes, null);

getProperties ??= typeof(IMutableEntityType)
.GetMethod("GetProperties", BindingFlags.Public | BindingFlags.Instance, null, CallingConventions.Any, Type.EmptyTypes, null);

if (getProperties == null)
throw new InvalidProgramException("Property GetProperties method not found.");
throw new InvalidProgramException("Method GetProperties method not found.");

Accessor.GetDynamicMethodFlags(false, out MethodAttributes attributes, out CallingConventions conventions);
DynamicMethod method = new DynamicMethod("GetProperties", attributes, conventions, typeof(IEnumerable<IMutableProperty>), [ typeof(IMutableEntityType) ], typeof(EFCompat), true);
Expand Down
2 changes: 1 addition & 1 deletion UncreatedWarfare/UncreatedWarfare.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<PropertyGroup>

<VersionPrefix>4.0.0</VersionPrefix>
<VersionBuild>004</VersionBuild>
<VersionBuild>005</VersionBuild>
<VersionSuffix>prerelease$(VersionBuild)</VersionSuffix>

</PropertyGroup>
Expand Down

0 comments on commit 731ac17

Please sign in to comment.