如何在模型和数据库中处理ICollection

时间:2014-08-13 10:43:08

标签: c# asp.net-mvc entity-framework icollection

我必须使用模型

将数据存储在数据库中

我的模特:

public class Poste
{
        public int Id { set; get; }

        public string intitule_poste { set; get; }

        public ICollection<Candidat> candidats { get; set; }
}


public class Candidat
{
        public int Id { set; get; }
        public List<Poste> postes {set;get;}
}

以便生成另一个名为PostesCandidats的表(使用EF)

PosteId   CandidatId

我的问题是:如何使用该List(Icollection)在PostesCandidats表中存储数据?

对于例子我想存储候选人并给他一个poste

0 个答案:

没有答案
相关问题