EntityFramework-Reverse-POCO-Code-First-Generator icon indicating copy to clipboard operation
EntityFramework-Reverse-POCO-Code-First-Generator copied to clipboard

Decimal type is missing precision and scale

Open ClassyCircuit opened this issue 7 years ago • 2 comments

Hi, For decimal type there are no properties generated, which would indicate how many numbers are allowed for this field. In our database we have limits set for each decimal field: image I would like to have a property, the same way you have made for nvarchar, that would tell what are the limits for each decimal field. Right now it generates the following:

[Column(@"PL_GrossAmount", Order = 7, TypeName = "decimal")]
[Required]
[Display(Name = "Pl gross amount")]
public decimal PlGrossAmount { get; set; } // PL_GrossAmount

Thanks

ClassyCircuit avatar Apr 25 '18 08:04 ClassyCircuit

@sjh37 is there a way to handle this for stored procedure return models? We have handled it with the tables returns using the Settings.UpdateColumn delegate and set the necessary precision and scale, but we havent been able to find where to set this for stored procedure return models.

agentKnipe avatar Apr 13 '20 15:04 agentKnipe

Hi @janissimsons Is this for EF Core? EF6 already supports the .HasPrecision(precision, scale) however support for EF Core was lacking. This has now been added to EF Core just 11 days ago, but so far has not yet been released. See https://github.com/dotnet/efcore/pull/20468

sjh37 avatar Apr 13 '20 17:04 sjh37