Created
January 16, 2017 07:11
-
-
Save pielegacy/067d5d2a0e739047acecb5686efa8556 to your computer and use it in GitHub Desktop.
The database context for our tomato database
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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