protected virtual ISession CreateSession()
    {
      IDbConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings[ConnectionStringName].ConnectionString);
      con.Open();
      Configuration cfg = new Configuration().Configure();

      var factory = cfg.BuildSessionFactory();
      return factory.OpenSession(con);
    }