aboutsummaryrefslogtreecommitdiff
path: root/src/DevHive.Data
diff options
context:
space:
mode:
Diffstat (limited to 'src/DevHive.Data')
-rw-r--r--src/DevHive.Data/Models/User.cs8
-rw-r--r--src/DevHive.Data/Repositories/UserRepository.cs2
2 files changed, 1 insertions, 9 deletions
diff --git a/src/DevHive.Data/Models/User.cs b/src/DevHive.Data/Models/User.cs
index ecd7af8..fd0ee7b 100644
--- a/src/DevHive.Data/Models/User.cs
+++ b/src/DevHive.Data/Models/User.cs
@@ -8,19 +8,13 @@ namespace DevHive.Data.Models
[Table("Users")]
public class User : IdentityUser<Guid>, IModel
{
- public override string UserName
- {
- get => base.UserName;
- set => base.UserName = value;
- }
-
public string FirstName { get; set; }
public string LastName { get; set; }
public string ProfilePicture { get; set; }
- public virtual List<Role> Roles { get; set; }
+ public virtual IList<Role> Roles { get; set; }
//public List<User> Friends { get; set; }
}
diff --git a/src/DevHive.Data/Repositories/UserRepository.cs b/src/DevHive.Data/Repositories/UserRepository.cs
index 1508947..130f96e 100644
--- a/src/DevHive.Data/Repositories/UserRepository.cs
+++ b/src/DevHive.Data/Repositories/UserRepository.cs
@@ -43,8 +43,6 @@ namespace DevHive.Data.Repositories
return await this._context
.Set<User>()
.Include(x => x.Roles)
- // To also return the roles, you need to include the roles table,
- // but then you loose FindAsync, because there is id of role and id of user
.FirstOrDefaultAsync(x => x.Id == id);
}