No rows are updated by the Save. Well, it may happen if NH thinks it needs to do it (e.g for identity keys), but in general updates happens when the session is flushed, and that may involve many entities. Implementing a correlation between an entity save and the number of rows updated is not a good idea, for that reason.
/G 2012/9/11 Felipe Oriani <[email protected]> > Hello guys, I would like to know, how can I get the affected rows when I > call session's methods like Save, Delete, SaveOrUpdate, etc... as we got > with ICommand.ExecuteNonQuery from Ado.Net? Is there any way to do this? I > have a repository implementation and I would like to return this value, > like this: > > public int Save(T entity) > { > session.Save(entity); > return ???; > } > > > Thank you! > > -- > ______________________________________ > Felipe B Oriani > felipeoriani.com.br [email protected] > "...Trabalhe quanto puder, tornando-se útil quanto possível..." , por > André Luiz > > -- > 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. > -- 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.
