mirror of
https://github.com/jcreek/advent-of-code.git
synced 2026-07-13 03:03:46 +00:00
chore(*): Move old solutions into a separate folder
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace Day06
|
||||
{
|
||||
public class FishContext : DbContext
|
||||
{
|
||||
public DbSet<Fish> Fishes { get; set; }
|
||||
|
||||
public string DbPath { get; }
|
||||
|
||||
public FishContext()
|
||||
{
|
||||
var folder = Environment.SpecialFolder.LocalApplicationData;
|
||||
var path = Environment.GetFolderPath(folder);
|
||||
DbPath = System.IO.Path.Join(path, "fishes.db");
|
||||
}
|
||||
|
||||
// The following configures EF to create a Sqlite database file in the
|
||||
// special "local" folder for your platform.
|
||||
protected override void OnConfiguring(DbContextOptionsBuilder options)
|
||||
=> options.UseSqlite($"Data Source={DbPath}");
|
||||
}
|
||||
|
||||
public class Fish
|
||||
{
|
||||
public int FishId { get; set; }
|
||||
public int InternalTimer { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user