I am trying to insert data stored in a link list into database using NHibernate via Fluenlty. Here my code (simplified):
public static void SaveUpdate(object obj, bool doFlush) { using (var session = _sessionFactory.OpenSession()) { session.SaveOrUpdate(obj); session.Flush(); } } Exception: No persister for: System.Collections.Generic.List`1[[BlueCrest.DataValidation.ValidationRuleDataModel.ValidationRuleBreakDetail, BlueCrest.DataValidation.VR_BreakDetail, Version=0.1.3751.29429, Culture=neutral, PublicKeyToken=null]]
Work around I found: list.ForEach(l => SessionFactory.SaveUpdate(l)); SessionFactory.Flush(); But, I think this is saving one record at a time.
How can i insert the enitre list into database? Thanks Leonard
|