Temp modification of NHibernate Entities

Posted by Marty Trenouth on Stack Overflow See other posts from Stack Overflow or by Marty Trenouth
Published on 2010-12-30T23:46:40Z Indexed on 2010/12/30 23:54 UTC
Read the original article Hit count: 196

Filed under:
|

Is there a way I can tell Nhibernate to ignore any future changes on a set of objects retrieved using it?

public ReturnedObject DoIt()
{
    List<MySuperDuperObject> awesomes = repository.GetMyAwesomenesObjects();
    var sp = new SuperParent();
    BusinessObjectWithoutNHibernateAccess.ProcessThese(i, awesomes,sp)
    repository.save(sp);
    return i;
}

public ReturnedObject FakeIt()
{
    List<MySuperDuperObject> awesomes = repository.GetMyAwesomenesObjects();
    var sp = new SuperParent();
    // should something go here to tell NHibernate to ignore changes to awesomes and sp?
    return BusinessObjectWithoutNHibernateAccess.ProcessThese(awesomes,sp)
}

© Stack Overflow or respective owner

Related posts about c#

Related posts about nhibernate