Esempio n. 1
0
		public void Initialize()
		{
			var connectionString = new ConnectionString("..\\..\\Database.sdf");
			var config = Fluently.Configure()
				.Database(MsSqlCeConfiguration.Standard.ConnectionString(connectionString.ToString()))
				.Mappings(m => m.FluentMappings.AddFromAssemblyOf<Person>())
				.ExposeConfiguration(x => x.SetProperty("connection.release_mode", "on_close"))
				.BuildConfiguration();

			connectionString.CreateDatabase(config);

			var sessions = config.BuildSessionFactory();
			Session = sessions.OpenSession();
		}