当前位置:网站首页>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);
}
边栏推荐
- [NLP] What is the memory of the model!
- uniapp小程序检查、提示更新
- 「SDOI2016」征途 题解
- Unity-通过预制件和克隆方法动态实现各个UGUI下控件的创建和显示
- cas and spin locks (is lightweight locks spin locks)
- Unity - LineRenderer show a line
- @JsonFormat(pattern="yyyy-MM-dd") time difference problem
- 《ArchSummit:时代的呐喊,技术人听得到》
- Write a database document management tool based on WPF repeating the wheel (1)
- 数据分析(一)——matplotlib
猜你喜欢

程序进程和线程(线程的并发与并行)以及线程的基本创建和使用

useragent online lookup

TestCafeSummary

Design of Fire and Anti-theft System Based on Single Chip GSM

手写一个简单的web服务器(B/S架构)

Go1.18 upgrade function - Fuzz test from scratch in Go language

Unity - by casting and cloning method dynamic control under various UGUI create and display

ICML2022 | 深入研究置换敏感的图神经网络

Binary tree non-recursive traversal

Interview assault 69: TCP reliable?Why is that?
随机推荐
Audio alignment using cross-correlation
A few permanent free network transmission, convenient and simple (Intranet through tutorials)
SQL注入 Less54(限制次数的SQL注入+union注入)
LeetCode 第 304 场周赛
[QNX Hypervisor 2.2用户手册]9.15 suppress
【Acwing】The 62nd Weekly Game Solution
不知道该怎么办的同步问题
A solution to the server encountered an internal error that prevented it from fulfilling this request [easy to understand]
Go1.18 upgrade function - Fuzz test from scratch in Go language
SQL injection Less54 (limited number of SQL injection + union injection)
标段参数说明
Bika LIMS open source LIMS set - use of SENAITE (detection process)
Transfer Learning - Domain Adaptation
[QNX Hypervisor 2.2 User Manual]9.16 system
cas and spin locks (is lightweight locks spin locks)
SQL27 View user details of different age groups
Design of Fire and Anti-theft System Based on Single Chip GSM
BOW/DOM (top)
消息队列消息存储设计(架构实战营 模块八作业)
Unity - by casting and cloning method dynamic control under various UGUI create and display