为什么 EntityType return 是上下文的命名空间,而不是实体的命名空间?

Why does EntityType return the namespace of the context, but not of the entity?

我需要从 EntityType.FullName 获取 CLR 实体类型,但它不正确。

我们的模型放置在与上下文不同的命名空间中。

当我检索 EntityType.FullName 时,它 returns <ContextNamespace>.<EntityName>,但不是 <EntityNamespace>.<EntityName>。这是一个功能吗?我做错了什么?

像往常一样...错误的假设。 CLR 类型在 DataSpace.OSpace 中可用。 CSpace 中的 EntityType 似乎包含 'virtual' 名称空间,与 CLR 的名称空间有些无关。

Rowan 写了一篇关于获取给定类型的元数据的好文章post

看起来 Name 是唯一将 CLR 类型与 EntityType 联系起来的东西。
我尝试使用来自不同命名空间但具有相同 class 名称的实体添加新的 DbSet。 EF 刚刚抛出了 InvalidOperationException.