var dbContext = Ioc.Container.GetInstance<MyDbContext>();
IEnumerable<Type> entityTypes = dbContext.GetType().GetTypeInfo().GetProperties()
.Where(aPropertyInfo => aPropertyInfo.PropertyType.Name.Contains(value: "DbSet"))
.Select(p => p.PropertyType.GenericTypeArguments.First());
我做了什么,但有更清洁的东西吗?