Hello. Im trying to insert object into SQLite InMembory database as follow:
private void button1_Click(object sender, EventArgs e)
{
var sessionFactory = CreateSessionFactory();
using (var session = sessionFactory.OpenSession())
{
Person p = new Person { Age = 25, FirstName = "Dariusz", LastName = "Smith" };
session.SaveOrUpdate(p);
//transaction.Commit();
}
}
private static ISessionFactory CreateSessionFactory()
{
return Fluently.Configure()
.Database(
SQLiteConfiguration.Standard.InMemory().ShowSql())
.Mappings(m => m.FluentMappings.AddFromAssemblyOf<Person>())
.BuildSessionFactory();
}
But Im getting ERROR: "SQLite error\r\nno such table: Person"
Just for clarification: Im using InMemory option.
I'm also using FluentNhibernate with mapping:
public class PersonMap : ClassMap<Person>
{
public PersonMap()
{
//Table("Person") doesn't resolve my problem
Id(x => x.Id);
Map(x => x.FirstName);
Map(x => x.LastName);
Map(x => x.Age);
}
}
What im doing wrong? Thanks in advance.