Skip to content

Instantly share code, notes, and snippets.

@pielegacy
Created January 16, 2017 07:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pielegacy/067d5d2a0e739047acecb5686efa8556 to your computer and use it in GitHub Desktop.
Save pielegacy/067d5d2a0e739047acecb5686efa8556 to your computer and use it in GitHub Desktop.
The database context for our tomato database
using Microsoft.EntityFrameworkCore;
namespace TomatoAPI
{
public class TomatoDb : DbContext
{
// Reference our tomato table using this
public DbSet<Tomato> Tomatos { get; set; }
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
optionsBuilder.UseSqlite("Filename=./Tomatos.db");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment