当前位置:网站首页>EntityFramework保存到SQLServer 小数精度丢失
EntityFramework保存到SQLServer 小数精度丢失
2022-07-31 22:43:00 【拥有必珍惜】
项目场景:
EntityFramework保存到SQLServer 小数精度丢失 ,字段Decimal类型
问题描述
EntityFramework保存到SQLServer 小数精度丢失 ,字段Decimal类型,经过验证数据库小数精度大于输入的数据精度,肯定不是出现在数据库程度,经过调查,出现在EntityFramework保存时的问题上。
解决方案
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.Entity<表>().Property(p => p.字段).HasPrecision(18, 4);
}
边栏推荐
- Shell common script: Nexus batch upload local warehouse script
- C#中引用类型的变量做为参数在方法调用时加不加 ref 关键字的不同之处
- ECCV 2022 Huake & ETH propose OSFormer, the first one-stage Transformer framework for camouflaging instance segmentation!The code is open source!...
- Pytest first experience
- -xms -xmx(information value)
- 内核对设备树的处理
- spark reports an error OutOfMemory "recommended collection"
- Summary of the classic drawing method of histogram
- JS basic exercises
- 基于单片机GSM的防火防盗系统的设计
猜你喜欢
The difference between adding or not adding the ref keyword when a variable of reference type is used as a parameter in a method call in C#
【ACM】2022.7.31训练赛
The latest masterpiece!Alibaba just released the interview reference guide (Taishan version), I just brushed it for 29 days
Pytest初体验
A shortcut to search for specific character content in idea
《ArchSummit:时代的呐喊,技术人听得到》
How to reduce the gap between software design and implementation
【Acwing】第62场周赛 题解
Document management and tools in the development process
Interview assault 69: TCP reliable?Why is that?
随机推荐
Bika LIMS open source LIMS set - use of SENAITE (detection process)
不知道该怎么办的同步问题
MySQL数据库‘反斜杠\’ ,‘单引号‘’,‘双引号“’,‘null’无法存储
Golang must know the Go Mod command
C#中引用类型的变量做为参数在方法调用时加不加 ref 关键字的不同之处
标段参数说明
[Code Hoof Set Novice Village 600 Questions] Leading to the combination of formulas and programs
How to import a Golang external package and use it?
高等代数_证明_任何矩阵都相似于一个上三角矩阵
Several methods of mysql backup table
内核对设备树的处理
uniapp小程序检查、提示更新
Components of TypeScript
TestCafeSummary
HTC使用官方固件作为底包制作rom卡刷包教程
VOT2021比赛简介
server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none failed
Collation of knowledge points in Ningbo University NBU IT project management final exam
A shortcut to search for specific character content in idea
嵌入式开发没有激情了,正常吗?