I have a simple class that looks like this:
public class Item {
// some properties
public virtual IDictionary<string, Detail> Details { get; private set; }
}
and then I have a map that looks like this:
map.HasMany(x => x.Details).AsMap<string>("Name").AsIndexedCollection<string>("Name", c => c.GetIndexMapping()).Cascade.All().KeyColumn("Item_Id"))
with this map I get the following error and I don’t know how to solve it?
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.
I found a workaround for this. Basically I’m preventing the automapper from attempting to map an IDictionary. It forces me to have to map it manually in an override but at least it works.
I’m using an AutomappingConfiguration derived from DefaultAutomappingConfiguration.
And here’s a couple of sample classes and the associated mapping that I’m using to make this happen:
I’ve just spent several hours to make this work, so I hope this saves someone else an evening of hair-pulling.