Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

List of Integers in Entity Framework

public Class Animal
{
    public int Id{get;set;}
    public string Name {get;set;}

    public ICollection<int> OwnerIds{ get; set; }
}

Animal class contains a list of int (ownerIds).

Entity framework is not creating a table for OwnerIds, how can i map this??

like image 323
Rusi Nova Avatar asked Aug 16 '11 06:08

Rusi Nova


1 Answers

Add second entity Owner, only property is int ID, add a relationship/association between them.

like image 120
nathanchere Avatar answered Nov 03 '22 05:11

nathanchere