mirror of
https://github.com/RaidMax/IW4M-Admin.git
synced 2025-06-15 01:28:34 -05:00
Moved from SQLITE to EntityFramework.
Lots of things are broken!
This commit is contained in:
27
Database/IW4MAdminDatabaseContext.cs
Normal file
27
Database/IW4MAdminDatabaseContext.cs
Normal file
@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data.Entity;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Database.Models;
|
||||
using System.Data.SqlServerCe;
|
||||
|
||||
namespace Database
|
||||
{
|
||||
public class IW4MAdminDatabaseContext : DbContext, SharedLibrary.Interfaces.IDatabaseContext
|
||||
{
|
||||
public DbSet<Client> Clients { get; set; }
|
||||
public DbSet<Alias> Aliases { get; set; }
|
||||
public DbSet<Penalty> Penalties { get; set; }
|
||||
|
||||
public IW4MAdminDatabaseContext() : base("DefaultConnection") { }
|
||||
protected override void OnModelCreating(DbModelBuilder modelBuilder)
|
||||
{
|
||||
var instance = System.Data.Entity.SqlServerCompact.SqlCeProviderServices.Instance;
|
||||
// todo custom load DBSets from plugins
|
||||
// https://aleemkhan.wordpress.com/2013/02/28/dynamically-adding-dbset-properties-in-dbcontext-for-entity-framework-code-first/
|
||||
base.OnModelCreating(modelBuilder);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user