Browse Source

Added user device skafolding

master
Teknikode 6 years ago
parent
commit
011e737846
  1. 3
      Teknik/Areas/User/Models/User.cs
  2. 24
      Teknik/Areas/User/Models/UserDevice.cs
  3. 2
      Teknik/Models/TeknikEntities.cs
  4. 1
      Teknik/Teknik.csproj

3
Teknik/Areas/User/Models/User.cs

@ -33,6 +33,8 @@ namespace Teknik.Areas.Users.Models @@ -33,6 +33,8 @@ namespace Teknik.Areas.Users.Models
public virtual UploadSettings UploadSettings { get; set; }
public virtual ICollection<UserDevice> Devices { get; set; }
public virtual ICollection<Upload.Models.Upload> Uploads { get; set; }
public virtual ICollection<Paste.Models.Paste> Pastes { get; set; }
@ -45,6 +47,7 @@ namespace Teknik.Areas.Users.Models @@ -45,6 +47,7 @@ namespace Teknik.Areas.Users.Models
JoinDate = DateTime.Now;
LastSeen = DateTime.Now;
Groups = new List<Group>();
Devices = new List<UserDevice>();
}
}
}

24
Teknik/Areas/User/Models/UserDevice.cs

@ -0,0 +1,24 @@ @@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Teknik.Attributes;
namespace Teknik.Areas.Users.Models
{
public class UserDevice
{
public int UserDeviceId { get; set; }
public int UserId { get; set; }
public virtual User User { get; set; }
public string Name { get; set; }
[CaseSensitive]
public string Token { get; set; }
public DateTime DateSeen { get; set; }
}
}

2
Teknik/Models/TeknikEntities.cs

@ -22,6 +22,7 @@ namespace Teknik.Models @@ -22,6 +22,7 @@ namespace Teknik.Models
public DbSet<User> Users { get; set; }
public DbSet<Group> Groups { get; set; }
public DbSet<Role> Roles { get; set; }
public DbSet<UserDevice> UserDevices { get; set; }
public DbSet<TransferType> TransferTypes { get; set; }
// User Settings
public DbSet<UserSettings> UserSettings { get; set; }
@ -111,6 +112,7 @@ namespace Teknik.Models @@ -111,6 +112,7 @@ namespace Teknik.Models
modelBuilder.Entity<User>().ToTable("Users");
modelBuilder.Entity<Group>().ToTable("Groups");
modelBuilder.Entity<Role>().ToTable("Roles");
modelBuilder.Entity<UserDevice>().ToTable("UserDevices");
modelBuilder.Entity<TransferType>().ToTable("TransferTypes");
modelBuilder.Entity<RecoveryEmailVerification>().ToTable("RecoveryEmailVerifications");
modelBuilder.Entity<ResetPasswordVerification>().ToTable("ResetPasswordVerifications");

1
Teknik/Teknik.csproj

@ -224,6 +224,7 @@ @@ -224,6 +224,7 @@
<Compile Include="Areas\User\Models\ResetPasswordVerification.cs" />
<Compile Include="Areas\User\Models\RecoveryEmailVerification.cs" />
<Compile Include="Areas\User\Models\SecuritySettings.cs" />
<Compile Include="Areas\User\Models\UserDevice.cs" />
<Compile Include="Models\TransferTypes.cs" />
<Compile Include="Areas\User\Models\UploadSettings.cs" />
<Compile Include="Areas\User\Models\UserSettings.cs" />

Loading…
Cancel
Save