I finally got it right looking at the unit test (why didnt I do that first :oops: )
Anyways, if someone is reading this far is because your intrested in an answer so here goes the code on how to do a generic DeleteById
Code:
public void DeleteById(System.Type clazz, object id)
{
try
{
//the next line depends on how you obtain the ISession in your app
ISession session = NHContext.Current.NHibernateSession;
session.Delete("from o in class " + clazz.Name + " where o.id = " + id.ToString());
}
catch (Exception ex)
{
//log error
throw;
}
}