Skip to content

Instantly share code, notes, and snippets.

@julielerman
Last active August 29, 2015 14:01
Show Gist options
  • Save julielerman/ff55cd76b8af1cea5eb2 to your computer and use it in GitHub Desktop.
Save julielerman/ff55cd76b8af1cea5eb2 to your computer and use it in GitHub Desktop.
trouble ...starts with a t and that rhymes with p
//debugging I can see this db getting created in file explorer
//the savechanges throws every time (from a test or from app) with SQLite exception "SQL logic error or missing database"
using (var contextCreateDb = new BreweryContext())
{
//database exists seems to be working with current ef7 build but not delete yet
//if (contextCreateDb.Database.Exists()) {
// contextCreateDb.Database.Delete(); //but delete doesnt work yet ;)
// }
await contextCreateDb.Database.CreateAsync();
}
using (var context = new BreweryContext()) {
context.Breweries.Add(Brewery.Create("a", "awesomesauce", "awesomesauce.com","x", "saucey"));
try {
await context.SaveChangesAsync();
}
catch (Exception ex) {
throw ex;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment