I started to use the latest s#arp architecture (1.9.5.0). I sometimes add some data to the db via a console application using something like this:
Repository<OriginalSequence> SequenceRepository = new Repository<OriginalSequence>();
...
SequenceRepository.SaveOrUpdate(Sequence);
SequenceRepository.DbContext.CommitChanges();
NHibernateSession.Current.Flush();
NHibernateSession.Current.Clear();
Unfortunately, I get:
ServiceLocator has not been initialized; I was trying to retrieve SharpArch.Data.NHibernate.ISessionFactoryKeyProvider
This has to do with DI I think. which is usually only necessary when I use it in a web app or has something fundamentally changed? Thanks.
Christian
PS:
Please note that I start off with:
string[] mappingAssemblies = new string[] { "Bla.Data" };
string configFile = "NHibernate.config";
NHibernate.Cfg.Configuration config = NHibernateSession.Init(
new SimpleSessionStorage(),
mappingAssemblies,
new AutoPersistenceModelGenerator().Generate(),
configFile);
This used to work fine.