public static void InitializeNhibernate() { //ISSession factory var configFile = HostingEnvironment.MapPath("~/" + AppSetting.NhibernateConfig); var mappingAssembly = typeof(Vienauto.Entity.Maps.ManufacturerMap).Assembly; NhibernateConfiguration.Init(configFile, mappingAssembly); }
public BootController(NhibernateConfiguration config) { _config = config; }
protected override ISession OpenSession(string factoryKey = "") { var sessionFactory = NhibernateConfiguration.GetSessionFactory(factoryKey); return(sessionFactory.OpenSession()); }
protected override ISession OpenDefaultSession() { var sessionFactory = NhibernateConfiguration.GetDefaultSessionFactory(); return(sessionFactory.OpenSession()); }