当前位置:网站首页>C# 使用Abp仓储访问数据库时报错记录集
C# 使用Abp仓储访问数据库时报错记录集
2022-07-28 00:33:00 【小丫头呀】
1.报错 The JSON value could not be converted to Volo.Abp.Data.ExtraPropertyDictionary.

1.2 解决方法1,在属性字段中增加数据契约标签DataContract,数据成员标签DataMember

1.3 解决方法二,去掉上面的数据标签,由于原来的实体类继承自集合根AggregateRoot,改成继承自Entity ,并且实现GetKeys方法
由于Entity 默认的Id是自增的,所以实现GetKeys 方法时,要这样处理。
public class UserRole : Entity { public virtual int Id{ get; protected set; } public UserRole() { } public override object[] GetKeys() { return new object[] { Id }; } }
2. 报错上下文实例被释放的问题
2.1 解决方法:在程序的报错方法贴上一个 UnitOfWork 标签
public class MyHandler:ITransientDependency
{
[UnitOfWork]
public async Task HandleEventAsync()
{
}
}以上基本解决了我的出现的问题。
边栏推荐
- js 哪些情况不能用 JSON.parse 、JSON.stringify深拷贝及一个更好的深拷贝方法
- Completely delete MySQL in Linux system
- After learning the loop, I came across the problem of writing factorial of N, which caused a series of problems, including some common pitfalls for beginners, and how to simplify the code
- Gbase 8C server signal function
- FreeRTOS内核小结
- 二叉树的遍历和性质
- Gbase 8C general file access function
- Domain Driven Design -- Terminology
- GBase 8c 备份控制函数(三)
- 简单为美-编程思路
猜你喜欢

Forget the root password

嵌入式经典通信协议

萤石网络,难当「孤勇者」

Traversal and properties of binary trees

忘记root密码

FreeRTOS kernel summary

##ELK日志分析系统搭建##

Leetcode high frequency question 128. the longest continuous sequence, which is often tested in interviews with Internet companies

Solution of digital commerce cloud supply chain centralized purchase management system: centralized purchase system management mode, digital control of enterprise materials

Embedded classic communication protocol
随机推荐
Custom type: structure, enumeration, union
Fiddler mobile packet capturing agent settings (for Huawei glory 60s)
GBase 8c 备份控制函数(一)
What are the important applications of MES system in manufacturing enterprises
##ELK日志分析系统搭建##
JS what situations can't use json Parse, json.stringify deep copy and a better deep copy method
Favorite songs
2022软件测试技能 Robotframework + SeleniumLibrary + Jenkins web关键字驱动自动化实战教程
Gbase 8C transaction ID and snapshot (VI)
Gbase 8C backup control function (IV)
机器学习如何做到疫情可视化——疫情数据分析与预测实战
企业运维实践-使用Aliyun容器镜像服务对海外gcr、quay仓库镜像进行镜像拉取构建
The story of amen
GBase 8c 配置设置函数
N32l43x FLASH read \ write \ erase operation summary
软件测试面试题:你所熟悉的软件测试类型有哪些?
The story of the third uncle
Gbase 8C transaction ID and snapshot (I)
Netease cloud copywriting
Blizzard Diablo 4 ps5 / PS4 beta added to Playstation database