Rasmus Christensen
Rasmus Christensen

Reputation: 8531

Map collection of timespan with Fluent NHibernate

I have an object that contains a collection of TimeSpan like Note.Reminders, where reminders is List<TimeSpan>. How to I map this using Fluent NHibernate?

Currently I have mapped it as m.HasMany(c=>c.Reminders).Access.CamelCaseField().

But it complains that it can not find a mapping for type TimeSpan.

Upvotes: 1

Views: 742

Answers (2)

Frederik Gheysels
Frederik Gheysels

Reputation: 56934

Also, make sure that the type in your database to store those timestamps is an Int64.

Upvotes: 0

David Schmitt
David Schmitt

Reputation: 59346

HasMany maps associations to other entities. TimeSpans are values, not entities. Therefore you should use Map(c=>c.Reminders); instead.

Upvotes: 0

Related Questions