我有一個實體,像這樣:如何使用Fluent NHibernate自動映射映射字典?
public class Land
{
public virtual IDictionary<string, int> Damages { get; set; }
// and other properties
}
每次我嘗試使用自動映射用下面的代碼:
var sessionFactory = Fluently.Configure()
.Database(SQLiteConfiguration.Standard.InMemory)
.Mappings(m => m.AutoMappings.Add(AutoMap.AssemblyOf<Land>))
.BuildSessionFactory();
我收到以下錯誤:
{"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."}
能
人告訴我我做錯了什麼?另外,這只是一個簡單的例子。我有更多的詞典比這個更多。
http://stackoverflow.com/questions/1410716/fluentnhibernate-mapping-for-dictionary 嘗試AsMap() – 2012-09-14 16:38:23