J'ai une entité comme ceci:Comment mapper un dictionnaire en utilisant le mappage NHibernate Fluent?
public class Land
{
public virtual IDictionary<string, int> Damages { get; set; }
// and other properties
}
Chaque fois que j'essaie d'utiliser AutoMapping avec le code suivant:
var sessionFactory = Fluently.Configure()
.Database(SQLiteConfiguration.Standard.InMemory)
.Mappings(m => m.AutoMappings.Add(AutoMap.AssemblyOf<Land>))
.BuildSessionFactory();
je reçois l'erreur suivante:
{"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."}
Quelqu'un peut-il dis-moi ce que je fais mal? En outre, ceci est juste un exemple simple. J'ai beaucoup plus de dictionnaires que celui-ci.
http://stackoverflow.com/questions/1410716/fluentnhibernate-mapping-for-dictionary Essayez AsMAP() –