当前位置:网站首页>EntityFramework saves to SQLServer decimal precision is lost
EntityFramework saves to SQLServer decimal precision is lost
2022-08-01 03:40:00 【To have must be cherished】
Project Scenario:
EntityFramework is saved to SQLServer, the decimal precision is lost, and the field is of Decimal type
Problem description
The decimal precision of EntityFramework is lost when it is saved to SQLServer. The field is of Decimal type. It has been verified that the decimal precision of the database is greater than the precision of the input data. It must not appear in the database level. After investigation, it appeared in the problem of saving EntityFramework.
Solution
protected override void OnModelCreating(ModelBuilder modelBuilder){modelBuilder.Entity<table>().Property(p => p.field).HasPrecisionspan>(18, 4);}
边栏推荐
- By CSDN, torn
- 2022 CSP-J1 CSP-S1 Round 1 Preliminary Competition Registration Guide
- 使用ts-node报错
- The IDEA can't find or unable to load The main class or Module "*" must not contain The source root "*" The root already belongs to The Module "*"
- 对无限debugger的一种处理方式
- When opening a MYSQL table, some can display editing, some do not, how to set.
- Flink deploys and submits jobs
- The maximum quantity leetcode6133. Grouping (medium)
- How to download the Keil package
- [uniCloud] Application and Improvement of Cloud Objects
猜你喜欢
MySQL4
Open source project site must-have & communication area function
软件测试周刊(第82期):其实所有纠结做选择的人心里早就有了答案,咨询只是想得到内心所倾向的选择。
设备树——dtb格式到struct device node结构体的转换
Valentine's Day Romantic 3D Photo Wall [with source code]
初出茅庐的小李第112篇博客项目笔记之机智云智能浇花器实战(1)-基础Demo实现
解决安装MySQL后,Excel打开很慢的问题
纽约大学等 | TM-Vec:用于快速同源检测和比对的模版建模向量
The maximum quantity leetcode6133. Grouping (medium)
win10 fixed local IP
随机推荐
黑客到底可以厉害到什么程度?
项目越写越大,我是这样做拆分的
"Youth Pie 2": The new boyfriend stepped on two boats, and the relationship between Lin Miaomiao and Qian Sanyi warmed up
ARM 交叉编译
win10 固定本机IP
HCIP(15)
解决IDEA默认情况下新建文件时,右击,new,没有XML文件的问题
设备树的树形结构到底是怎样体现的?
Basic implementation of vector
HCIP (14)
【uniCloud】云对象的应用与提升
让你的 Lottie 支持文字区域内自动换行
Make your Lottie support word wrapping in text fields
Ordinary users cannot access HGFS directory
Completely closed Chrome updated and in the top right corner of the tip
The fledgling Xiao Li's 114th blog project notes: Wisdom cloud intelligent flower watering device combat (3) - basic Demo implementation
Parse the bootargs from the device tree (dtb format data)
New York University et al | TM-Vec: Template Modeling Vectors for Rapid Homology Detection and Alignment
指定set 'execution.savepoint.path'后,重启flinksql报这个错是啥
MYSQL two-phase commit