Hi,

what is the recommended way to delete multiple records that have not
previously been read from the database using CreateCriteria ?

This is what I do:

          //first get all the downloads with DateTime >= fromDateTime.
          IList<Download> downloads = session
            .CreateCriteria(typeof(Download))
            .Add(Restrictions.Gt("DateTime", fromDateTime)) //DateTime
> fromDateTime.
            .List<Download>();

          //now delete the downloads
          foreach (Download download in downloads)
          {
            session.Delete(download);
          }

Is there any way using CreateCriteria to do this in one call. Is
session.Delete("from Download d where d.DateTime >"+fromDateTime) the
only way ?

Kind regards
Peter

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" 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/nhusers?hl=en.

Reply via email to