I'm following some tutorial about ASP.net MVC on visual Studio, and currently I'm doing the part about DataBase, Code First
I do not understand why, but my DataAnnotations do not seem to be taken into account.
[Table("Restos")]
public class Resto
{
public int Id { get; set; }
[Required][MaxLength(10)]
public string Nom { get; set; }
public string Telephone { get; set; }
}
In fact, I created a class "Resto", so the name of the table was automatically named "Restoes", but I don't want this name, I want "Restos", without "e" So to oblige my "Restoes" table to call itself "Restos", I used the [Table ("Restos")] annotation but it didnt change its name, And the [Required] annotation on one of the Fields in my "Restoes" table also has no effect because the "Nullable" property is always at True.
Could you help me please ?