This commit is contained in:
Ryan Peters 2023-04-03 21:56:57 -04:00
parent 2c1b0404a6
commit 7fc7464e13
5 changed files with 44 additions and 0 deletions

11
DbContext.cs Normal file
View File

@ -0,0 +1,11 @@
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
using Sequence.Entities;
public class DbContext : IdentityDbContext<User, IdentityRole<Guid>, Guid>
{
public DbContext(DbContextOptions<DbContext> options) : base(options) { }
public DbSet<Card> Cards { get; set; }
}

8
Entities/Card.cs Normal file
View File

@ -0,0 +1,8 @@
namespace Sequence.Entities;
public class Card
{
public Guid Id { get; set; }
public Suit Suit { get; set; }
public string Value { get; set; }
}

8
Entities/User.cs Normal file
View File

@ -0,0 +1,8 @@
using Microsoft.AspNetCore.Identity;
namespace Sequence.Entities;
public class User : IdentityUser<Guid>
{
public string Name { get; set; }
}

View File

@ -6,4 +6,14 @@
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="7.0.4" />
<PackageReference Include="Microsoft.AspNetCore.Identity.UI" Version="7.0.4" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="7.0.4">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="7.0.0" />
</ItemGroup>
</Project>

7
Suit.cs Normal file
View File

@ -0,0 +1,7 @@
public enum Suit
{
Hearts = 0,
Diamonds = 1,
Spades = 2,
Clubs = 3
}