Browse Source

Added user device skafolding

tags/2.0.3
Teknikode 4 years ago
parent
commit
011e737846

+ 3
- 0
Teknik/Areas/User/Models/User.cs View File

@@ -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
JoinDate = DateTime.Now;
LastSeen = DateTime.Now;
Groups = new List<Group>();
Devices = new List<UserDevice>();
}
}
}

+ 24
- 0
Teknik/Areas/User/Models/UserDevice.cs View File

@@ -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
- 0
Teknik/Models/TeknikEntities.cs View File

@@ -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
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
- 0
Teknik/Teknik.csproj View File

@@ -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