0

I was building an MVC asp.net core Application. For defining the models we can use two syntaxes.

 class Category
{
    [Key]
     public int id ;

    public string Name ;

    public int DisplayOrder ;
}

Does it makes any difference in defining the model in any of the two ways ?

 class Category
{
    [Key]
     public int id { get; set; }

    public string Name { get; set; }

    public int DisplayOrder { get; set; }
}
marc_s
  • 704,970
  • 168
  • 1,303
  • 1,425
Pulkit Sharma
  • 87
  • 1
  • 6

0 Answers0