1.3.5.Overriding conventions

    1. To limit column to non-nullable, modify the code:

namespace Vidly2.Models
{
    public class Customer
    {
        public int Id{ get; set; }
        [Required]
        [StringLength(255)]
        public string Name { get; set; }
        public bool IsSubscribeToNesletter { get; set; }
        public MembershipType membershipType { get; set; }
        public byte membershipTypeId { get; set; }
    }
}
  • 2.Update database:

      `update-database`

Last updated