This commit is contained in:
Paul Schneider
2021-07-05 12:55:52 +01:00
parent 5de53a3cba
commit 476d35ae8a
270 changed files with 476 additions and 400 deletions

View File

@ -0,0 +1,32 @@
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
using isn.Data;
using isn.Data.ApiKeys;
namespace isn.Data
{
public class ApplicationDbContext : IdentityDbContext<ApplicationUser>
{
public ApplicationDbContext(DbContextOptions<ApplicationDbContext> options)
: base(options)
{
}
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
base.OnModelCreating(modelBuilder);
modelBuilder.Entity<PackageVersion>().HasKey(v => new
{
v.PackageId,
v.FullString,
v.Type
});
}
public DbSet<ApiKey> ApiKeys { get; set; }
public DbSet<Package> Packages { get; set; }
public DbSet<PackageVersion> PackageVersions { get; set; }
}
}