views:

156

answers:

0

Hi all, I have a Fluent NHibernate mapping like this.

public PersonMap()
{
  Table("PERSON");
  Map(x => x.FirstName)
   .Not.Nullable();
  Map(x => x.LastName)
   .Not.Nullable();


  HasMany(x => x.Ids)
   .AsMap<string>("id_type")
   .Cascade.SaveUpdate();
}

So I could do something like this.

Person p = new Person();
p.Ids["id1"] = "00123";
p.Ids["id2"] = "00356";

Person p2 = new Person();
p2.Ids["id2"] = "00123";

How could I create a criteria to get the a person who has p.Ids["id1"] == "00123" only?

Thanks!