Fluent mapping of IDictionary

Original Post MylesRip's Avatar

MylesRip

14 Apr, 2010 10:20 PM via web

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?

    Reply to this discussion

    Preview Comments are parsed with Markdown. Help with syntax

    Attached Files

      You can attach files up to 10MB

      What is the opposite of north?

      Recent Discussions

      05 Jul, 2010 10:29 PM
      05 Jul, 2010 12:45 PM
      05 Jul, 2010 12:42 PM
      05 Jul, 2010 12:17 PM
      05 Jul, 2010 12:12 PM

       

      03 Jul, 2010 12:26 AM
      02 Jul, 2010 02:17 PM
      02 Jul, 2010 08:18 AM
      02 Jul, 2010 12:20 AM
      01 Jul, 2010 10:14 PM