I want to create a Table with 3 columns, one for each property of my Libro entity, but when the table is created it has only two columns, id and Titulo, without my navigation property "Comments"
This is the Entity class
public class Libro
{
public int id { get; set; }
[Required]
public string Titulo { get; set; }
public List<Comment> Comments { get; set; }
}
This is the migration file
migrationBuilder.CreateTable(
name: "Libros",
columns: table => new
{
id = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
Titulo = table.Column<string>(type: "nvarchar(max)", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Libros", x => x.id);
});
There is no such thing as a database list structure, it is the association structure you create, click on the link for more detailed information.