I've tried with the following:
[TestMethod]
public void Can_Load_And_Save_Product()
{
var container = new WindsorContainer(new XmlInterpreter());
container.AddComponentLifeStyle("nhibernate.session.interceptor",
typeof(IInterceptor),
typeof(TimestampInterceptor),
LifestyleType.Transient);
container.AddComponentLifeStyle("nhibernate.sessionfactory.interceptor",
typeof(IInterceptor),
typeof(TimestampInterceptor),
LifestyleType.Transient);
var sessionFactory = container.Resolve<ISessionFactory>();
using (var session = sessionFactory.OpenSession())
{
Product product = new Product { Name =
"[EMAIL PROTECTED]" };
session.Save(product);
session.Flush();
session.Evict(product);
Product loadedProduct = session.Load<Product>(product.Id);
Assert.AreEqual(product.Name, loadedProduct.Name);
}
}
Still my TimestampInterceptor (inherits from EmptyInterceptor) methods
never get called.... my windsor config just contains the NH facility
config. I'm a bit baffled.
On Wed, Oct 22, 2008 at 7:02 PM, Germán Schuager <[EMAIL PROTECTED]> wrote:
>
> http://gschuager.blogspot.com/2008/04/nhibernatesearch-with.html
>
> On Oct 21, 7:45 pm, "Colin Ramsay" <[EMAIL PROTECTED]> wrote:
> > Hi all,
> >
> > What's the best way to set up an NHibernate Interceptor if I'm using the
> > NHibernate facility?
> >
> > Thanks,
> > Colin.
> >
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Castle Project Users" 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/castle-project-users?hl=en
-~----------~----~----~----~------~----~------~--~---