views:

16

answers:

1

I have a mapping structured in this way: public class Person

{
   public IDictionary<bool, Action> Actions { get; set; }
}

public class Action
{
   public string Name { get; set; }
}

// Map for Person

public class PersonMap : ClassMap<Person>
{
   public PersonMap()
   {
      Id(x => x.Id) ...
      Map(x => x.Name) ...
      Table("Persons")
   }
}

// Map for Action

public class ActionMap : ActionMap<Action>
{
   public ActionMap()
   {
      Id(x => x.Id) ...
      Map(x => x.Name) ...
      Table("Actions")
   }
}

What I need to do now is this. I need a third table that will contains this fields:

PersonId ActionId True/false

Because I have the collection of actions inside the class person i was thinking about using a manytomany, but I can't find documentation on how to map an IDictionary. Any idea? Wrong approach?

A: 

Dunno if you've already found the solution but there's been a recent update(only a couple weeks ago) where you could simply map it as HasManyToMany(x => x.NameOfDictionary) so you might want to update your FNH.

I haven't tried it yet though but here's the link: mailing list post

Nai
Thanks I am gonna have a look and see if it's available in the latest built.Thanks again

related questions