2021-04-25 12:12:50 +01:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.Text;
|
2021-05-22 22:49:57 +01:00
|
|
|
|
using Microsoft.AspNetCore.Identity;
|
2021-04-25 12:12:50 +01:00
|
|
|
|
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
|
|
|
|
|
|
using Microsoft.EntityFrameworkCore;
|
2021-08-15 19:09:01 +01:00
|
|
|
|
using isnd.Data;
|
|
|
|
|
|
using isnd.Data.ApiKeys;
|
2021-04-25 12:12:50 +01:00
|
|
|
|
|
2021-08-15 19:09:01 +01:00
|
|
|
|
namespace isnd.Data
|
2021-04-25 12:12:50 +01:00
|
|
|
|
{
|
|
|
|
|
|
public class ApplicationDbContext : IdentityDbContext<ApplicationUser>
|
|
|
|
|
|
{
|
|
|
|
|
|
public ApplicationDbContext(DbContextOptions<ApplicationDbContext> options)
|
|
|
|
|
|
: base(options)
|
|
|
|
|
|
{
|
|
|
|
|
|
}
|
2021-05-22 22:49:57 +01:00
|
|
|
|
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
|
|
|
|
|
{
|
|
|
|
|
|
base.OnModelCreating(modelBuilder);
|
2021-06-21 23:38:05 +01:00
|
|
|
|
modelBuilder.Entity<PackageVersion>().HasKey(v => new
|
2021-05-22 22:49:57 +01:00
|
|
|
|
{
|
2021-06-21 23:38:05 +01:00
|
|
|
|
v.PackageId,
|
|
|
|
|
|
v.FullString,
|
|
|
|
|
|
v.Type
|
2021-05-22 22:49:57 +01:00
|
|
|
|
});
|
|
|
|
|
|
}
|
2021-05-02 16:37:03 +01:00
|
|
|
|
public DbSet<ApiKey> ApiKeys { get; set; }
|
2021-05-16 14:07:14 +01:00
|
|
|
|
public DbSet<Package> Packages { get; set; }
|
|
|
|
|
|
public DbSet<PackageVersion> PackageVersions { get; set; }
|
2021-04-25 12:12:50 +01:00
|
|
|
|
}
|
|
|
|
|
|
}
|