当前位置:网站首页>EntityFramework saves to SQLServer decimal precision is lost
EntityFramework saves to SQLServer decimal precision is lost
2022-08-01 03:40:00 【To have must be cherished】
Project Scenario:
EntityFramework is saved to SQLServer, the decimal precision is lost, and the field is of Decimal type
Problem description
The decimal precision of EntityFramework is lost when it is saved to SQLServer. The field is of Decimal type. It has been verified that the decimal precision of the database is greater than the precision of the input data. It must not appear in the database level. After investigation, it appeared in the problem of saving EntityFramework.
Solution
protected override void OnModelCreating(ModelBuilder modelBuilder){modelBuilder.Entity<table>().Property(p => p.field).HasPrecisionspan>(18, 4);}边栏推荐
猜你喜欢

黑客到底可以厉害到什么程度?

Game Security 03: A Simple Explanation of Buffer Overflow Attacks
![Valentine's Day Romantic 3D Photo Wall [with source code]](/img/a9/2c26f4f048f3c0a9a65551bc734233.png)
Valentine's Day Romantic 3D Photo Wall [with source code]

树莓派 的 arm 版的 gcc 安装 和环境变量的配置

MYSQL query interception optimization analysis

彻底关闭Chrome浏览器更新及右上角的更新提示

Weekly Summary (*67): Why not dare to express an opinion

开源项目站点必备&交流区功能

ARM 交叉编译

Ordinary users cannot access HGFS directory
随机推荐
[Search topic] After reading the inevitable BFS solution to the shortest path problem
修改Postman安装路径
JS new fun(); class and instance JS is based on object language Can only act as a class by writing constructors
情人节浪漫3D照片墙【附源码】
785. Quick Sort
Nmap manuals - the full version
Valentine's Day Romantic 3D Photo Wall [with source code]
简单易用的任务队列-beanstalkd
<JDBC> 批量插入 的四种实现方式:你真的get到了吗?
链式编程、包、访问权限
IDEA调试
Unknown Bounded Array
MySQL modifies SQL statements to optimize performance
The IDEA can't find or unable to load The main class or Module "*" must not contain The source root "*" The root already belongs to The Module "*"
[cellular automata] based on matlab interface aggregation cellular automata simulation [including Matlab source code 2004]
Handwritten binary search tree and test
HIRO: Hierarchical Reinforcement Learning 】 【 Data - Efficient Hierarchical Reinforcement Learning
HCIP(15)
ARM cross compilation
初出茅庐的小李第112篇博客项目笔记之机智云智能浇花器实战(1)-基础Demo实现