Fluent NHibernate Config

 privatestatic ISessionFactory CreateSessionFactory()
  {
            return Fluently.Configure()

                .Database(
                    FluentNHibernate.Cfg.Db.MySqlConfiguration.Standard
                        .ConnectionString(s => s.Server(".")
                                .Database("MyNHibernate")
                                .Username("")

            .Password("")))

        .Mappings(x=>x.FluentMappings.AddFromAssembly(Assembly.Load("myDAL")))
                ).BuildSessionFactory();
  }

你可能感兴趣的:(Hibernate)