首页 > 代码库 > Found more than one concrete type for given DbContext Type (xxx.xxxx.xxx) define MultiTenancySideAttribute with Tenant
Found more than one concrete type for given DbContext Type (xxx.xxxx.xxx) define MultiTenancySideAttribute with Tenant
错误提示:
Found more than one concrete type for given DbContext Type (Abp.Zero.EntityFramework.AbpZeroCommonDbContext`2[Easyman.Authorization.Roles.Role,Easyman.Users.User]) define MultiTenancySideAttribute with Tenant. Found types: Easyman.EntityFramework.EasymanDbContext, Easyman.EntityFramework, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null, Easyman.EntityFramework.EmProjectDbContext, Em.Project.EntityFramework, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null.
错误原由:找到满足User的映射的多个DbContext
我的项目中,EF有多级继承,继承结构如下:
public abstract class EasymanDbContext : AbpZeroDbContext<Tenant, Role, User> public class EmProjectDbContext: EasymanDbContext
此处有一个细节处理:应该将继承AbpZeroDbContext的子类EasymanDbContext 设置为抽象类abstract,理由是抽象类不会被实例化
Found more than one concrete type for given DbContext Type (xxx.xxxx.xxx) define MultiTenancySideAttribute with Tenant
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。