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,理由是抽象类不会被实例化

时间: 2024-10-22 02:19:11

Found more than one concrete type for given DbContext Type (xxx.xxxx.xxx) define MultiTenancySideAttribute with Tenant的相关文章

C语言 结构体指针赋值 incompatible types when assigning to type &#39;char[20]&#39; from type &#39;char *&#39;

strcpy(pstudent->name, "guo zhao wei "); 为什么错误,该怎么写,(红色行) 追问 为什么不能直接赋值啊, 追答 用char nnnn[20]定义的,用strcpy 用char *ppp定义的,用=来赋值 C语言 结构体指针赋值 incompatible types when assigning to type 'char[20]' from type 'char *'

用GPIO_WriteBit时产生enumerated type mixed with another type警告

在keil里面写STM32程序,这样写GPIO_WriteBit(GPIOC,GPIO_Pin_9,1),编译的时候就报enumerated type mixed with another type警告,  这说明数据类型混用了,进入GPIO_WriteBit函数发现其原型是void GPIO_WriteBit(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin, BitAction BitVal)这样的 ,BitAction这个是枚举,所以要类型转换 即把GPIO_W

jauery改变inout的type属性报错type property can’t be changed

uncaught exception type property can't be changed 使用代码$("#pwd").attr("type","password")时出现上面的错误. 猜测是该版本jQuery不允许修改控件type属性,使用原生js语句可以解决这个问题. [javascript] view plain copy $("#txtpwd").focus(function () { if ($(this).

No context type was found in the assembly &#39;xxx.xxxx&#39;. CodeFirst Ef错误

最简单的解决方案是将启动项目设置为你要生产Migration的项目. 例如: 我这边将Try.EntityFramework设置为启动项目.并且准备在该项目下生成Migration文件.这里的默认项目同样设置为Try.EntityFramework.就OK了. 2.另一种方案. 查看get-help Enable-Migrations帮助,发现启用迁移命令带了几个参数. Enable-Migrations [-ContextTypeName <String>] [-EnableAutomati

Host does not support domain type kvm for virtualization type &#39;hvm&#39; arch &#39;x86_64&#39;

kvm创建虚拟机报错: qemu-img create -f qcow2 /tmp/centos.qcow2 10G virt-install --virt-type kvm --name centos --ram 1024 --disk /tmp/centos.qcow2,format=qcow2 --network network=default --graphics vnc,listen=0.0.0.0 --noautoconsole --os-type=linux --os-varian

Unable to cast object of type &#39;System.Int32&#39; to type &#39;System.String&#39;.

最近在研究.netcore,尝试把前后端完全分离.但是在写接口的时候,Post参数是FromBody的时候报错了 Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware[1] An unhandled exception has occurred while executing the request. System.InvalidCastException: Unable to cast object of type

JAVA错误提示:The operation is not applicable to the current selection.Select a field which is not declared as type variable or a type that declares such fields.

平时没怎么注意,今天用Eclipse自动生成Set Get方法时提示错误,错误信息如下: The operation is not applicable to the current selection.Select a field which is not declared as type variable or a type that declares such fields. 原因: 解决方案:将光标定位到类内部自动生成Set.Get即可 原文地址:https://www.cnblogs.

SpringBoot: Field xxx in xxx required a bean of type &#39;xxx&#39; that could not be found.

SpringBoot自动注入报了如下错误 . 原因是我这个模块依赖另一个模块里面的被Spring管理的类,但是不在同一包下面, 并且启动类不是在根包下面,所以就导致了springboot启动的时候扫描不到,也就管理不到这个类,也就无法找到, 解决方案: 1.SpringBoot启动类放到包的跟包下面比如每个包都包含 cn.arebirth.xx  那就放在cn.arbeirth下面 2.设置SpringBoot扫描的包路径即可解决 SpringBoot: Field xxx in xxx req

&lt;input type=&quot;radio&quot; &gt;与&lt;input type=&quot;checkbox&quot;&gt;值得获取

<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> <%@taglib prefix="s" uri="/struts-tags"%> <!DOCTYPE html> <html> <head> <meta http-equiv="content-