2017-06-01 20:54:32 +00:00
|
|
|
namespace CircleScape.DAL {
|
|
|
|
using System;
|
|
|
|
using System.Data.Entity;
|
|
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
|
|
using System.Linq;
|
2017-04-27 20:44:30 +00:00
|
|
|
|
2017-06-01 20:54:32 +00:00
|
|
|
public partial class Database : DbContext {
|
|
|
|
public Database()
|
|
|
|
: base("name=Database") {
|
|
|
|
}
|
|
|
|
|
|
|
|
public virtual DbSet<Session> Sessions { get; set; }
|
|
|
|
public virtual DbSet<User> Users { get; set; }
|
|
|
|
|
|
|
|
protected override void OnModelCreating(DbModelBuilder modelBuilder) {
|
|
|
|
modelBuilder.Entity<User>()
|
|
|
|
.HasMany(e => e.Sessions)
|
|
|
|
.WithRequired(e => e.User)
|
|
|
|
.WillCascadeOnDelete(false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|