NHibernate Evict By Type вместо instance

Я переношу такое приложение:

Vehicle v = null;
using (ISession session = MyNHibernateSession())
{
    v = Vehicle.FindById(1);
}

using (ISession session = MyNHibernateSession())
{
    // somwwhere into these4 lines Vehicle comes Finded
    DoSomething();
    DoSomething2();
    DoSomething3();
    DoSomething4();
    DoSomething5();
    DoSomething6();

    // if i do this i get an error "another object with the same id etc etc etc
    session.Update(v);
}

Я не хочу делать что-то вроде этого:

    session.EvictAllByType(typeof(Vehicle));

возможно ли это? как?, спасибо

7
задан manuellt 5 March 2012 в 16:04
поделиться