I am sorry for making probably a duplicate question, but for some reason I am having a hard time finding answer for my question
How to mark entity's property to always have value while it is non-nullable?
Example:
public class ExampleEntity
{
// How to mark that this column cannot be a default decimal value?
[Required]
public decimal Amount { get; set; }
}
The column definition in generated EF migration looks like this:
...
Amount = table.Column<decimal>(type: "numeric", nullable: false)
...
This is still allowing me to pass 0 as a value for this column. How to disallow this?
P.S.: I am using PostgreSQL