我有一個對象,其中包含TimeSpan
的集合,如Note.Reminders
,其中提醒是List<TimeSpan>
。我如何使用Fluent NHibernate來映射它?使用流利NHibernate的時間跨度的地圖集合
當前我已將其映射爲m.HasMany(c=>c.Reminders).Access.CamelCaseField()
。
但它抱怨說它無法找到TimeSpan
類型的映射。
我有一個對象,其中包含TimeSpan
的集合,如Note.Reminders
,其中提醒是List<TimeSpan>
。我如何使用Fluent NHibernate來映射它?使用流利NHibernate的時間跨度的地圖集合
當前我已將其映射爲m.HasMany(c=>c.Reminders).Access.CamelCaseField()
。
但它抱怨說它無法找到TimeSpan
類型的映射。
HasMany
將協會映射到其他實體。 TimeSpan
是值,而不是實體。因此,您應該使用Map(c=>c.Reminders);
。
另外,請確保數據庫中用於存儲這些時間戳的類型是Int64。