I have an entity with children. I need to loop through the children
and update a date time field. When I try to save the parent (item) or
the child (doc) I get the Don't change the reference to a collection
with cascade="all-delete-orphan" error. Funny thing is I don't think I
am changing the reference to the collection, just setting a date
field.

I get this error whether I save with the parent _opsItemRepository or
the _OpsItemRepository.

            var item = _OpsItemRepository.Get(OpsItemId);
            if (item != null)
            {
                foreach (var doc in  item.OpsDocs)
                {
                    var fullFileName = Path.Combine
(TIFDestinationPath, doc.OpsDocId + ".TIF");
                    if (!doc.Exported.HasValue)
                    {
                        if (File.Exists(finalFileName))
                        {
                             doc.Exported = DateTime.Now;
                             _OpsDocRepository.SaveOrUpdate(doc);
                         }
                    }
                }
            }


Any ideas?

Thanks,
Nigel
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Fluent NHibernate" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/fluent-nhibernate?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to