EntityFramework 학습 노트의 Decimal 정밀도 제어
2143 단어 framework
1 public class EFDbContext : DbContext
2 {
3 protected override void OnModelCreating(System.Data.Entity.DbModelBuilder modelBuilder)
4 {
5 modelBuilder.Entity<Class>().Property(object => object.property).HasPrecision(12, 10);
6
7 base.OnModelCreating(modelBuilder);
8 }
9 }
1 public DecimalPropertyConfiguration HasPrecision(
2 byte precision,
3 byte scale )
This is to show how to configure the precision by overriding the DbContext.OnModelCreating() method.
You can check information about this on the page: http://stackoverflow.com/questions/3504660/entity-framework-code-first-decimal-precision-and-scale
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
Fragmenta의 각서라고 할까, 그것 밖에 발견되지 않았기 때문에 시도해보기로 했습니다. 다만, 내용을 보면 어플리케이션을 만드는 프레임워크로서 사용되는 것도 의식하고 있는 것 같습니다. 하지만, 지금은 정확하지 않은 것 같기 때문에,...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.