У меня есть столбец Price
в одной из моих таблиц SQL Server:
Price decimal(20, 2)
В модели, сгенерированной Entity Framework, это выглядит так:
public Nullable<decimal> Price { get; set; }
При получении записи я получаю только 3 вместо 3,15! В чем может быть проблема?
Entity_Product eProduct = new Entity_Product();
var pr = new DataModel.Entity_Product();
pr = Init.ProductRepository.GetById(ProductId);
eProduct.Name = pr.Name;
eProduct.CommercialName = pr.CommercialName;
eProduct.PackageType = pr.PackageType;
eProduct.DrugType = pr.DrugType;
eProduct.DrugCode = pr.DrugCode;
eProduct.ProductId = pr.ProductId;
eProduct.Administration = pr.Administration;
eProduct.Manufacturer = pr.Manufacturer;
eProduct.Price = pr.Price;
eProduct.Strength = pr.Strength;
eProduct.StregnthUnit = pr.StregnthUnit;
eProduct.Barcode = pr.Barcode;
eProduct.IsEnabled = pr.IsEnabled;
eProduct.CreatedOn = pr.CreatedOn;
eProduct.CreatedBy = pr.CreatedBy;
eProduct.UpdatedOn = pr.UpdatedOn;
eProduct.UpdatedBy = pr.UpdatedBy;
return eProduct;
public T GetById(params object[] idies)
{
return ContextProvider.Set<T>().Find(idies);
}