If I put [Required]
attribue over a property in a model then the <input>
helper tag will throw out a validation error if no value is provided, but also it will be affecting database structure.
However does this
modelBuilder.Entity<CartItem>(e =>
{
e.Property(e=>e.Quantity).IsRequired();
}
do the same? Meaning is this causing somehow dynamically adding [Required]
attribute to a property so <input>
tag helper can notice it?