当前位置:网站首页>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);
}
边栏推荐
- SQL injection Less54 (limited number of SQL injection + union injection)
- 内核对设备树的处理
- 了解下C# 匿名方法
- The article you worked so hard to write may not be your original
- [QNX Hypervisor 2.2用户手册]9.15 suppress
- 高等代数_证明_任何矩阵都相似于一个上三角矩阵
- hboot and recovery, boot.img, system.img
- Design of Fire and Anti-theft System Based on Single Chip GSM
- 21. Support Vector Machine - Introduction to Kernel Functions
- Network security - crack WiFi through handshake packets (detailed tutorial)
猜你喜欢
Go1.18 upgrade function - Fuzz test from scratch in Go language
C程序设计-方法与实践(清华大学出版社)习题解析
flowable workflow all business concepts
iNeuOS industrial Internet operating system, equipment operation and maintenance business and "low-code" form development tools
IDA PRO中汇编结构体识别
Shell常用脚本:Nexus批量上传本地仓库增强版脚本(强烈推荐)
Unity-通过预制件和克隆方法动态实现各个UGUI下控件的创建和显示
基于单片机GSM的防火防盗系统的设计
VOT2021比赛简介
Go mode tidy reports an error go warning “all” matched no packages
随机推荐
Unity - LineRenderer show a line
UOS统信系统 - WindTerm使用
JS basic exercises
Daily--Kali opens SSH (detailed tutorial)
消息队列存储消息数据的MySQL表格
21. Support Vector Machine - Introduction to Kernel Functions
Handwritten a simple web server (B/S architecture)
Fixed-length usage of nanopb string type based on RT1052 Aworks (27)
[QNX Hypervisor 2.2 User Manual]9.14 set
基于simulink的Active anti-islanding-AFD主动反孤岛模型仿真
Golang - from entry to abandonment
面试突击69:TCP 可靠吗?为什么?
SQL injection Less42 (POST type stack injection)
uniapp小程序检查、提示更新
Bionic caterpillar robot source code
日常--Kali开启SSH(详细教程)
Weekly Summary
LevelSequence source code analysis
C#中引用类型的变量做为参数在方法调用时加不加 ref 关键字的不同之处
如何导入 Golang 外部包并使用它?