I am using SQLite wrapper provided by http://sqlite.phxsoftware.com in VS2010
Here is the code that I am using
static void Main(string[] args)
{
INFO inf = INFO.CreateINFO("test5", 123);
TestDBEntities3 entity = new TestDBEntities3();
entity.Connection.Open();
entity.Connection.BeginTransaction();
var result = from i in entity.INFOes
where i.Name.Equals(inf.Name)
select i;
if (result.Count() == 0)
entity.AddToINFOes(inf);
entity.SaveChanges(true);
entity.Connection.Close();
}
When I execute the code data do not persist to the database. I am checking the right database mentioned in the connection string of App.config file.
Also I can re run the query without changing the primarykey data and no primary key conflict occurs.
But during the debug at line
entity.Connection.Close();
'entity' has the new created record in it but does not save.
Thanks