当前位置:网站首页>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);
}
边栏推荐
- [QNX Hypervisor 2.2 User Manual]9.14 set
- 21. Support Vector Machine - Introduction to Kernel Functions
- 日常--Kali开启SSH(详细教程)
- 内核对设备树的处理
- Binary tree non-recursive traversal
- Drawing process of hand-drawn map of scenic spots
- Chapter Six
- How to identify fake reptiles?
- iNeuOS industrial Internet operating system, equipment operation and maintenance business and "low-code" form development tools
- Several methods for deleting specified elements in Golang slices
猜你喜欢

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

Go mode tidy reports an error go warning “all” matched no packages

日常--Kali开启SSH(详细教程)

VOT2021比赛简介

Advanced Algebra _ Proof _ Any matrix is similar to an upper triangular matrix

Bionic caterpillar robot source code

登录业务实现(单点登录+微信扫码+短信服务)

A shortcut to search for specific character content in idea

Shell常用脚本:Nexus批量上传本地仓库增强版脚本(强烈推荐)

ThreadLocal
随机推荐
了解下C# 匿名方法
基于单片机GSM的防火防盗系统的设计
Niuke.com brush questions (1)
Transfer Learning - Domain Adaptation
如何导入 Golang 外部包并使用它?
cas and spin locks (is lightweight locks spin locks)
SQL注入 Less38(堆叠注入)
Daily--Kali opens SSH (detailed tutorial)
Istio introduction
TypeScript 的组件
Summary of the classic drawing method of histogram
Shell common script: Nexus batch upload local warehouse script
SQL injection Less38 (stack injection)
Shell common scripts: Nexus batch upload local warehouse enhanced version script (strongly recommended)
Golang must know the Go Mod command
SQL injection Less47 (error injection) and Less49 (time blind injection)
Flex layout in detail
[Code Hoof Set Novice Village 600 Questions] Leading to the combination of formulas and programs
Quick Start Tutorial for flyway
「SDOI2016」征途 题解