Rusi Nova
Rusi Nova

Reputation: 2655

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??

Upvotes: 6

Views: 4138

Answers (1)

nathanchere
nathanchere

Reputation: 8098

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

Upvotes: 9

Related Questions