feat(*): Update 2021-06 files (part 1 working, part 2 not I think, but unable to test on laptop due to CPU limitations)

This resolves the out of memory issue, but still takes too long to run. It's either CPU or IO bound.
This commit is contained in:
Josh Creek
2021-12-06 13:09:24 +00:00
committed by GitHub
parent 3feeeb566c
commit 259637aa6e
7 changed files with 216 additions and 14 deletions
+31
View File
@@ -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; }
}
}