Skip to content

Commit

Permalink
移除冗余代码
Browse files Browse the repository at this point in the history
  • Loading branch information
yihango committed Nov 4, 2020
1 parent ffa1040 commit 1c446b5
Showing 1 changed file with 0 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,5 @@ public static bool HasRelationalTransactionManager(this DbContext dbContext)
{
return dbContext.Database.GetService<IDbContextTransactionManager>() is IRelationalTransactionManager;
}

public static IEnumerable<EntityTypeInfo> GetEntityTypeInfos(this Type dbContextType)
{
return
from property in dbContextType.GetProperties(BindingFlags.Public | BindingFlags.Instance)
where
(ReflectionHelper.IsAssignableToGenericType(property.PropertyType, typeof(DbSet<>)) ||
ReflectionHelper.IsAssignableToGenericType(property.PropertyType, typeof(DbQuery<>))) &&
ReflectionHelper.IsAssignableToGenericType(property.PropertyType.GenericTypeArguments[0],
typeof(IEntity<>))
select new EntityTypeInfo(property.PropertyType.GenericTypeArguments[0], property.DeclaringType);
}
}
}

0 comments on commit 1c446b5

Please sign in to comment.