0

I've found a number of posts about this but none seem to help me directly. Also there seems to be confusion about solutions working or not working during different stages of FluentNHibernate's development.

I have the following classes:

public class MappedClass
{
    ...
}

public enum MyEnum
{
    One,
    Two
}

public class Foo
{
    ...
    public virtual IDictionary<MappedClass, MyEnum> Values { get; set; }
}

My questions are:

  1. Will I need a separate (third) table of MyEnum?
  2. How can I map the MyEnum type? Should I?
  3. What should Foo's mapping look like?

I've tried mapping HasMany(x => x.Values).AsMap("MappedClass")... This results in: NHibernate.MappingException : Association references unmapped class: MyEnum

anthony
  • 40,424
  • 5
  • 55
  • 128

1 Answers1

0

It looks like this questions is a duplicate of Fluent code for mapping an IDictionary<SomeEntity, int>?. The solution was to use hbm.xml to map a ternary association table. It looks like at the time FluentNHibernate's AsTernaryAssocation() method only worked for entity types. I can't tell if this has changed, or if it is a planned feature.

Community
  • 1
  • 1
anthony
  • 40,424
  • 5
  • 55
  • 128