2017-08-18 21:01:11 +00:00
|
|
|
using System;
|
|
|
|
using System.Data.Entity;
|
|
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
|
|
using System.Linq;
|
|
|
|
using Config = SockScape.Configuration;
|
2017-06-05 12:20:39 +00:00
|
|
|
|
2017-08-18 21:01:11 +00:00
|
|
|
namespace SockScape.DAL {
|
2017-06-05 12:20:39 +00:00
|
|
|
[DbConfigurationType(typeof(MySql.Data.Entity.MySqlEFConfiguration))]
|
2017-06-02 21:02:48 +00:00
|
|
|
public partial class ScapeDb : DbContext {
|
|
|
|
static ScapeDb() {
|
2017-06-05 12:20:39 +00:00
|
|
|
DbConfiguration.SetConfiguration(new MySql.Data.Entity.MySqlEFConfiguration());
|
2017-06-02 21:02:48 +00:00
|
|
|
}
|
2017-06-05 12:20:39 +00:00
|
|
|
|
|
|
|
public ScapeDb()
|
2017-08-18 21:01:11 +00:00
|
|
|
: base("server="+ Config.Database["Server"]
|
|
|
|
+";user id="+ Config.Database["Username"]
|
|
|
|
+";password="+ Config.Database["Password"]
|
|
|
|
+";persistsecurityinfo=True;"
|
|
|
|
+"database="+ Config.Database["Database"])
|
2017-06-05 12:20:39 +00:00
|
|
|
{
|
2017-06-02 21:02:48 +00:00
|
|
|
|
2017-06-01 20:54:32 +00:00
|
|
|
}
|
|
|
|
|
2017-06-05 12:20:39 +00:00
|
|
|
public DbSet<User> Users { get; set; }
|
|
|
|
public DbSet<Origin> Origins { get; set; }
|
2017-06-06 21:13:25 +00:00
|
|
|
public DbSet<Session> Sessions { get; set; }
|
2017-06-02 21:02:48 +00:00
|
|
|
|
|
|
|
|
2017-06-05 12:20:39 +00:00
|
|
|
protected override void OnModelCreating(DbModelBuilder modelBuilder) {
|
|
|
|
base.OnModelCreating(modelBuilder);
|
2017-06-01 20:54:32 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|