Skip to content

Commit

Permalink
Remove remnants of workaround for dotnet/efcore#25127.
Browse files Browse the repository at this point in the history
  • Loading branch information
lauxjpn committed Nov 9, 2021
1 parent ff2319f commit fb7d600
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 49 deletions.
8 changes: 0 additions & 8 deletions src/EFCore.MySql/EFCore.MySql.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@
<!-- TODO: Add Microsoft.EntityFrameworkCore as well for .NET 5. Makes it easier for users. -->
<!-- PrivateAssets="none" is set to flow the EF Core analyzer to users referencing this package https://github.com/aspnet/EntityFrameworkCore/pull/11350 -->
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" PrivateAssets="none" />

<!-- TODO: Remove after CSharpEntityTypeGenerator has been fixed in EF Core upstream (6.0.0-preview.6). -->
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" PrivateAssets="none" />
</ItemGroup>

<ItemGroup Condition="'$(LocalMySqlConnectorRepository)' == ''">
Expand All @@ -45,11 +42,6 @@
<HintPath>$(LocalEFCoreRepository)\artifacts\bin\EFCore.Relational\Debug\$(TargetFramework)\Microsoft.EntityFrameworkCore.Relational.dll</HintPath>
</Reference>

<!-- TODO: Remove after CSharpEntityTypeGenerator has been fixed in EF Core upstream (6.0.0-preview.6). -->
<Reference Include="Microsoft.EntityFrameworkCore.Design">
<HintPath>$(LocalEFCoreRepository)\artifacts\bin\EFCore.Design\Debug\$(TargetFramework)\Microsoft.EntityFrameworkCore.Design.dll</HintPath>
</Reference>

<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" />
<PackageReference Include="Microsoft.Extensions.Configuration" />
<PackageReference Include="Microsoft.Extensions.Caching.Memory" />
Expand Down
41 changes: 0 additions & 41 deletions src/Shared/SharedTypeExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,6 @@ namespace System
[DebuggerStepThrough]
internal static class SharedTypeExtensions
{
private static readonly Dictionary<Type, string> _builtInTypeNames = new()
{
{ typeof(bool), "bool" },
{ typeof(byte), "byte" },
{ typeof(char), "char" },
{ typeof(decimal), "decimal" },
{ typeof(double), "double" },
{ typeof(float), "float" },
{ typeof(int), "int" },
{ typeof(long), "long" },
{ typeof(object), "object" },
{ typeof(sbyte), "sbyte" },
{ typeof(short), "short" },
{ typeof(string), "string" },
{ typeof(uint), "uint" },
{ typeof(ulong), "ulong" },
{ typeof(ushort), "ushort" },
{ typeof(void), "void" }
};

public static Type UnwrapNullableType(this Type type) => Nullable.GetUnderlyingType(type) ?? type;

public static bool IsNullableType(this Type type)
Expand Down Expand Up @@ -276,27 +256,6 @@ public static object GetDefaultValue(this Type type)
: Activator.CreateInstance(type);
}

public static IEnumerable<string> GetNamespaces(this Type type)
{
if (_builtInTypeNames.ContainsKey(type))
{
yield break;
}

yield return type.Namespace!;

if (type.IsGenericType)
{
foreach (var typeArgument in type.GenericTypeArguments)
{
foreach (var ns in typeArgument.GetNamespaces())
{
yield return ns;
}
}
}
}

public static MethodInfo GetRequiredRuntimeMethod(this Type type, string name, params Type[] parameters)
=> type.GetTypeInfo().GetRuntimeMethod(name, parameters)
?? throw new InvalidOperationException($"Could not find method '{name}' on type '{type}'");
Expand Down

0 comments on commit fb7d600

Please sign in to comment.