Found more than one concrete type for given DbContext Type (xxx.xxxx.xxx) define MultiTenancySideAtt
Posted 儿时精神
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Found more than one concrete type for given DbContext Type (xxx.xxxx.xxx) define MultiTenancySideAtt相关的知识,希望对你有一定的参考价值。
错误提示:
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 MultiTenancySideAtt的主要内容,如果未能解决你的问题,请参考以下文章
Android异常篇 More than one file was found with OS independent path ‘xxx/xxx‘
More than one file was found with OS independent path ‘lib/armeabi-v7a/xxx.so‘
关于报错“More than one fragment with the name [spring_web] was found. This is not legal ...”的解决办法
关于报错“More than one fragment with the name [spring_web] was found. This is not legal ...”的解决办法
More than one file was found with OS independent path 'lib/arm64-v8a/libsqlite.so'
我的Android进阶之旅彻底解决Android Studio编译so库的时候报错:More than one file was found with OS independent path