|
|
@ -1,14 +1,14 @@
|
|
|
|
using System;
|
|
|
|
using System;
|
|
|
|
using System.Data.Common;
|
|
|
|
using System.Data.Common;
|
|
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
|
|
|
|
using Model;
|
|
|
|
|
|
|
|
|
|
|
|
namespace EntityFrameworkLib
|
|
|
|
namespace EntityFrameworkLib
|
|
|
|
{
|
|
|
|
{
|
|
|
|
public class LolContext : DbContext
|
|
|
|
public class LolContext : DbContext
|
|
|
|
{
|
|
|
|
{
|
|
|
|
public DbSet<ChampionEntity> Champions { get; set; }
|
|
|
|
public DbSet<ChampionEntity> Champions { get; set; }
|
|
|
|
|
|
|
|
public LolContext() { }
|
|
|
|
public LolContext () { }
|
|
|
|
|
|
|
|
public LolContext(DbContextOptions<LolContext> options)
|
|
|
|
public LolContext(DbContextOptions<LolContext> options)
|
|
|
|
: base(options) { }
|
|
|
|
: base(options) { }
|
|
|
|
|
|
|
|
|
|
|
@ -19,5 +19,14 @@ namespace EntityFrameworkLib
|
|
|
|
base.OnConfiguring(options.UseSqlite($"DataSource=projet.Champions.db"));
|
|
|
|
base.OnConfiguring(options.UseSqlite($"DataSource=projet.Champions.db"));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*protected override void OnModelCreating(ModelBuilder modelBuilder)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
modelBuilder.Entity<ChampionEntity>()
|
|
|
|
|
|
|
|
.Property(c => c.Image)
|
|
|
|
|
|
|
|
.IsRequired(false);
|
|
|
|
|
|
|
|
modelBuilder.Entity<LargeImage>()
|
|
|
|
|
|
|
|
.HasKey(li => li.Base64);
|
|
|
|
|
|
|
|
}*/
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|