Skip to content

Instantly share code, notes, and snippets.

@yostane
Created May 9, 2017 20:33
Show Gist options
  • Select an option

  • Save yostane/68f27bb83f22de83f74222964957db2a to your computer and use it in GitHub Desktop.

Select an option

Save yostane/68f27bb83f22de83f74222964957db2a to your computer and use it in GitHub Desktop.
using Microsoft.EntityFrameworkCore;
namespace efcore_tuto_1
{
/// <summary>
/// This class handles the sqlite database
/// </summary>
public class VideoGamesDatabaseContext : DbContext
{
/// <summary>
/// This property allows to manipoulate the video games table
/// </summary>
public DbSet<VideoGame> VideoGames {get; set;}
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) {
// Specify the path of the database here
optionsBuilder.UseSqlite("Filename=./video_games.sqlite");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment