Skip to content

Instantly share code, notes, and snippets.

@LarsBergqvist
Created February 3, 2020 18:07
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 LarsBergqvist/99b950114a54a5ea3bd0d6df5cd8dbc9 to your computer and use it in GitHub Desktop.
Save LarsBergqvist/99b950114a54a5ea3bd0d6df5cd8dbc9 to your computer and use it in GitHub Desktop.
DbContext implementation for Location entities with a Sqlite database
using Microsoft.EntityFrameworkCore;
using LocPoc.Contracts;
namespace LocPoc.Repository.Sqlite
{
public class SqliteContext: DbContext
{
public SqliteContext(DbContextOptions<SqliteContext> options) : base(options)
{
}
public DbSet<Location> Locations { get; set; }
protected override void OnConfiguring(DbContextOptionsBuilder options)
=> options.UseSqlite("Data Source=locpoc.db");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment