Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.