mirror of
https://github.com/jcreek/advent-of-code.git
synced 2026-07-14 19:53:46 +00:00
chore(*): Move old solutions into a separate folder
This commit is contained in:
@@ -8,12 +8,12 @@
|
|||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="6.0.0">
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="6.0.0">
|
||||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="6.0.0" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="6.0.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
+37
-37
@@ -1,37 +1,37 @@
|
|||||||
// <auto-generated />
|
// <auto-generated />
|
||||||
using Day06;
|
using Day06;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||||
|
|
||||||
#nullable disable
|
#nullable disable
|
||||||
|
|
||||||
namespace _06.Migrations
|
namespace _06.Migrations
|
||||||
{
|
{
|
||||||
[DbContext(typeof(FishContext))]
|
[DbContext(typeof(FishContext))]
|
||||||
[Migration("20211206123902_InitialCreate")]
|
[Migration("20211206123902_InitialCreate")]
|
||||||
partial class InitialCreate
|
partial class InitialCreate
|
||||||
{
|
{
|
||||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||||
{
|
{
|
||||||
#pragma warning disable 612, 618
|
#pragma warning disable 612, 618
|
||||||
modelBuilder.HasAnnotation("ProductVersion", "6.0.0");
|
modelBuilder.HasAnnotation("ProductVersion", "6.0.0");
|
||||||
|
|
||||||
modelBuilder.Entity("Day06.Fish", b =>
|
modelBuilder.Entity("Day06.Fish", b =>
|
||||||
{
|
{
|
||||||
b.Property<int>("FishId")
|
b.Property<int>("FishId")
|
||||||
.ValueGeneratedOnAdd()
|
.ValueGeneratedOnAdd()
|
||||||
.HasColumnType("INTEGER");
|
.HasColumnType("INTEGER");
|
||||||
|
|
||||||
b.Property<int>("InternalTimer")
|
b.Property<int>("InternalTimer")
|
||||||
.HasColumnType("INTEGER");
|
.HasColumnType("INTEGER");
|
||||||
|
|
||||||
b.HasKey("FishId");
|
b.HasKey("FishId");
|
||||||
|
|
||||||
b.ToTable("Fishes");
|
b.ToTable("Fishes");
|
||||||
});
|
});
|
||||||
#pragma warning restore 612, 618
|
#pragma warning restore 612, 618
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+31
-31
@@ -1,31 +1,31 @@
|
|||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
#nullable disable
|
#nullable disable
|
||||||
|
|
||||||
namespace _06.Migrations
|
namespace _06.Migrations
|
||||||
{
|
{
|
||||||
public partial class InitialCreate : Migration
|
public partial class InitialCreate : Migration
|
||||||
{
|
{
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
{
|
{
|
||||||
migrationBuilder.CreateTable(
|
migrationBuilder.CreateTable(
|
||||||
name: "Fishes",
|
name: "Fishes",
|
||||||
columns: table => new
|
columns: table => new
|
||||||
{
|
{
|
||||||
FishId = table.Column<int>(type: "INTEGER", nullable: false)
|
FishId = table.Column<int>(type: "INTEGER", nullable: false)
|
||||||
.Annotation("Sqlite:Autoincrement", true),
|
.Annotation("Sqlite:Autoincrement", true),
|
||||||
InternalTimer = table.Column<int>(type: "INTEGER", nullable: false)
|
InternalTimer = table.Column<int>(type: "INTEGER", nullable: false)
|
||||||
},
|
},
|
||||||
constraints: table =>
|
constraints: table =>
|
||||||
{
|
{
|
||||||
table.PrimaryKey("PK_Fishes", x => x.FishId);
|
table.PrimaryKey("PK_Fishes", x => x.FishId);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
{
|
{
|
||||||
migrationBuilder.DropTable(
|
migrationBuilder.DropTable(
|
||||||
name: "Fishes");
|
name: "Fishes");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+35
-35
@@ -1,35 +1,35 @@
|
|||||||
// <auto-generated />
|
// <auto-generated />
|
||||||
using Day06;
|
using Day06;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||||
|
|
||||||
#nullable disable
|
#nullable disable
|
||||||
|
|
||||||
namespace _06.Migrations
|
namespace _06.Migrations
|
||||||
{
|
{
|
||||||
[DbContext(typeof(FishContext))]
|
[DbContext(typeof(FishContext))]
|
||||||
partial class FishContextModelSnapshot : ModelSnapshot
|
partial class FishContextModelSnapshot : ModelSnapshot
|
||||||
{
|
{
|
||||||
protected override void BuildModel(ModelBuilder modelBuilder)
|
protected override void BuildModel(ModelBuilder modelBuilder)
|
||||||
{
|
{
|
||||||
#pragma warning disable 612, 618
|
#pragma warning disable 612, 618
|
||||||
modelBuilder.HasAnnotation("ProductVersion", "6.0.0");
|
modelBuilder.HasAnnotation("ProductVersion", "6.0.0");
|
||||||
|
|
||||||
modelBuilder.Entity("Day06.Fish", b =>
|
modelBuilder.Entity("Day06.Fish", b =>
|
||||||
{
|
{
|
||||||
b.Property<int>("FishId")
|
b.Property<int>("FishId")
|
||||||
.ValueGeneratedOnAdd()
|
.ValueGeneratedOnAdd()
|
||||||
.HasColumnType("INTEGER");
|
.HasColumnType("INTEGER");
|
||||||
|
|
||||||
b.Property<int>("InternalTimer")
|
b.Property<int>("InternalTimer")
|
||||||
.HasColumnType("INTEGER");
|
.HasColumnType("INTEGER");
|
||||||
|
|
||||||
b.HasKey("FishId");
|
b.HasKey("FishId");
|
||||||
|
|
||||||
b.ToTable("Fishes");
|
b.ToTable("Fishes");
|
||||||
});
|
});
|
||||||
#pragma warning restore 612, 618
|
#pragma warning restore 612, 618
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,31 +1,31 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
|
||||||
namespace Day06
|
namespace Day06
|
||||||
{
|
{
|
||||||
public class FishContext : DbContext
|
public class FishContext : DbContext
|
||||||
{
|
{
|
||||||
public DbSet<Fish> Fishes { get; set; }
|
public DbSet<Fish> Fishes { get; set; }
|
||||||
|
|
||||||
public string DbPath { get; }
|
public string DbPath { get; }
|
||||||
|
|
||||||
public FishContext()
|
public FishContext()
|
||||||
{
|
{
|
||||||
var folder = Environment.SpecialFolder.LocalApplicationData;
|
var folder = Environment.SpecialFolder.LocalApplicationData;
|
||||||
var path = Environment.GetFolderPath(folder);
|
var path = Environment.GetFolderPath(folder);
|
||||||
DbPath = System.IO.Path.Join(path, "fishes.db");
|
DbPath = System.IO.Path.Join(path, "fishes.db");
|
||||||
}
|
}
|
||||||
|
|
||||||
// The following configures EF to create a Sqlite database file in the
|
// The following configures EF to create a Sqlite database file in the
|
||||||
// special "local" folder for your platform.
|
// special "local" folder for your platform.
|
||||||
protected override void OnConfiguring(DbContextOptionsBuilder options)
|
protected override void OnConfiguring(DbContextOptionsBuilder options)
|
||||||
=> options.UseSqlite($"Data Source={DbPath}");
|
=> options.UseSqlite($"Data Source={DbPath}");
|
||||||
}
|
}
|
||||||
|
|
||||||
public class Fish
|
public class Fish
|
||||||
{
|
{
|
||||||
public int FishId { get; set; }
|
public int FishId { get; set; }
|
||||||
public int InternalTimer { get; set; }
|
public int InternalTimer { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,3 +1,3 @@
|
|||||||
Run dotnet ef database update to initialise the database
|
Run dotnet ef database update to initialise the database
|
||||||
Delete the database if you want to run the code again
|
Delete the database if you want to run the code again
|
||||||
It's at C:\Users\Josh\AppData\Local as fishes.db and other associated files
|
It's at C:\Users\Josh\AppData\Local as fishes.db and other associated files
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user