Fluent mapping of IDictionary
Given the following:
public class ClassA
{
public IDictionary<int, ClassB> Details = new Dictionary<int, ClassB>();
...
}
public class ClassB
{
public ClassA ClassA;
public int MapKey;
...
}
I'm using fluent nhibernate automapping with the following overrides:
public class ClassAOverride : IAutoMappingOverride<ClassA>
{
mapping.HasMany<ClassB>(x => x.Details).Inverse().AsMap(x => x.MapKey).Cascade.AllDeleteOrphan();
}
public class ClassBOverride : IAutoMappingOverride<ClassB>
{
mapping.References<ClassA>(x => x.ClassA).Not.Nullable();
}
At runtime I get the following error from the "Configure" statement:
"The type or method has 2 generic parameter(s), but 1 generic argument(s) were provided. A generic argument must be provided for each generic parameter."
How can I make this work?