当前位置:网站首页>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);
}
边栏推荐
- 周总结
- HTC使用官方固件作为底包制作rom卡刷包教程
- How to debug TestCafe
- Drawing process of hand-drawn map of scenic spots
- Design of Fire and Anti-theft System Based on Single Chip GSM
- 一文带你了解 Grafana 最新开源项目 Mimir 的前世今生
- 标段参数说明
- Golang must know the Go Mod command
- Write a database document management tool based on WPF repeating the wheel (1)
- Federated Learning: Multi-source Knowledge Graph Embedding in Federated Scenarios
猜你喜欢

网络安全--通过握手包破解WiFi(详细教程)

Unity-通过预制件和克隆方法动态实现各个UGUI下控件的创建和显示

Federated Learning: Multi-source Knowledge Graph Embedding in Federated Scenarios

UOS统信系统 - WindTerm使用

Flex layout in detail

嵌入式开发没有激情了,正常吗?

Shell common scripts: Nexus batch upload local warehouse enhanced version script (strongly recommended)

How to reduce the gap between software design and implementation

Audio alignment using cross-correlation

The latest masterpiece!Alibaba just released the interview reference guide (Taishan version), I just brushed it for 29 days
随机推荐
cas and spin locks (is lightweight locks spin locks)
UserAgent resolution
GateWay implements load balancing
支付模块实现
Shell常用脚本:Nexus批量上传本地仓库增强版脚本(强烈推荐)
Verilog implements a divide-by-9 with a duty cycle of 5/18
Bika LIMS open source LIMS set - use of SENAITE (detection process)
[QNX Hypervisor 2.2 User Manual]9.14 set
@JsonFormat(pattern=“yyyy-MM-dd“)时间差问题
20. Support vector machine - knowledge of mathematical principles
"APIO2010" Patrol Problem Solution
How to get useragent
Interview assault 69: TCP reliable?Why is that?
Collation of knowledge points in Ningbo University NBU IT project management final exam
Judging decimal points and rounding of decimal operations in Golang
Program processes and threads (concurrency and parallelism of threads) and basic creation and use of threads
不知道该怎么办的同步问题
嵌入式开发没有激情了,正常吗?
MLP神经网络,GRNN神经网络,SVM神经网络以及深度学习神经网络对比识别人体健康非健康数据
SQL injection Less42 (POST type stack injection)