I'm interested in how to use an interface as a proxy rather than having to make all the properties and methods of a class virtual. I'd really prefer to have sealed classes.
When I try to use an interface as a proxy I'm getting an error when trying to build a SessionFactory:
Code:
NHibernate.Impl.SessionFactoryImpl: 2005-09-12 10:18:48,672 [5788] DEBUG NHibernate.Impl.SessionFactoryImpl [(null)] <(null)> - instantiating session factory with properties: {hibernate.dialect=NHibernate.Dialect.MsSql2000Dialect, hibernate.query.substitutions=true 1, false 0, hibernate.connection.connection_string=Data source=SROTTEM\VSDotNet;Initial Catalog=Framework;User Id=sa;Password=sqladmin, hibernate.connection.provider=NHibernate.Connection.DriverConnectionProvider, hibernate.connection.driver_class=NHibernate.Driver.SqlClientDriver}
Object reference not set to an instance of an object.
at NHibernate.PropertyNotFoundException..ctor(Type type, String fieldName)
at NHibernate.Property.FieldAccessor.GetField(Type type, String fieldName)
at NHibernate.Property.FieldAccessor.GetField(Type type, String fieldName)
at NHibernate.Property.FieldAccessor.GetGetter(Type theClass, String propertyName)
at NHibernate.Mapping.Property.GetGetter(Type clazz)
at NHibernate.Persister.AbstractEntityPersister..ctor(PersistentClass model, ISessionFactoryImplementor factory)
at NHibernate.Persister.EntityPersister..ctor(PersistentClass model, ISessionFactoryImplementor factory)
at NHibernate.Persister.PersisterFactory.CreateClassPersister(PersistentClass model, ISessionFactoryImplementor factory)
at NHibernate.Impl.SessionFactoryImpl..ctor(Configuration cfg, Settings settings)
at NHibernate.Cfg.Configuration.BuildSessionFactory()
at Framework.Core.Repository..ctor(String dbConnectionString) in C:\Documents and Settings\Symon\My Documents\Visual Studio Projects\Framework.Core\Repository.cs:line 79
at Framework.Core.Tests.FullPrivilegeTestCase.TestFixtureSetup() in C:\Documents and Settings\Symon\My Documents\Visual Studio Projects\Framework.Tests\FullPrivilegeTestCase.cs:line 117
I've just added a proxy attribute to the class referring to the interface for the class.
Anyone got any information on this?
Cheers,
Symon.