aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/DevHive.Data/DevHiveContext.cs9
-rw-r--r--src/DevHive.Data/Repositories/UserRepository.cs12
-rw-r--r--src/DevHive.Services/Services/UserService.cs1
-rw-r--r--src/DevHive.Web/Configurations/Extensions/ConfigureDatabase.cs4
4 files changed, 10 insertions, 16 deletions
diff --git a/src/DevHive.Data/DevHiveContext.cs b/src/DevHive.Data/DevHiveContext.cs
index c1bda49..17e16e7 100644
--- a/src/DevHive.Data/DevHiveContext.cs
+++ b/src/DevHive.Data/DevHiveContext.cs
@@ -27,6 +27,15 @@ namespace DevHive.Data
builder.Entity<User>()
.HasMany(x => x.Friends);
+ builder.Entity<User>()
+ .HasMany(x => x.Languages);
+
+ builder.Entity<User>()
+ .HasMany(x => x.Technologies);
+
+ builder.Entity<User>()
+ .HasChangeTrackingStrategy(ChangeTrackingStrategy.Snapshot);
+
base.OnModelCreating(builder);
}
}
diff --git a/src/DevHive.Data/Repositories/UserRepository.cs b/src/DevHive.Data/Repositories/UserRepository.cs
index 6d4a175..06bafca 100644
--- a/src/DevHive.Data/Repositories/UserRepository.cs
+++ b/src/DevHive.Data/Repositories/UserRepository.cs
@@ -49,18 +49,6 @@ namespace DevHive.Data.Repositories
}
#endregion
- #region Update
- public override async Task<bool> EditAsync(Guid id, User newEntity)
- {
- User user = await GetByIdAsync(id);
-
- this._context.Update(user);
- user = newEntity;
-
- return await this.SaveChangesAsync(this._context);
- }
- #endregion
-
#region Validations
public async Task<bool> DoesUserExistAsync(Guid id)
{
diff --git a/src/DevHive.Services/Services/UserService.cs b/src/DevHive.Services/Services/UserService.cs
index 0e3bf72..abbecb1 100644
--- a/src/DevHive.Services/Services/UserService.cs
+++ b/src/DevHive.Services/Services/UserService.cs
@@ -71,6 +71,7 @@ namespace DevHive.Services.Services
user.PasswordHash = PasswordModifications.GeneratePasswordHash(registerModel.Password);
// Make sure the default role exists
+ //TODO: Move when project starts
if (!await this._roleRepository.DoesNameExist(Role.DefaultRole))
await this._roleRepository.AddAsync(new Role { Name = Role.DefaultRole });
diff --git a/src/DevHive.Web/Configurations/Extensions/ConfigureDatabase.cs b/src/DevHive.Web/Configurations/Extensions/ConfigureDatabase.cs
index 6e92a65..1a80984 100644
--- a/src/DevHive.Web/Configurations/Extensions/ConfigureDatabase.cs
+++ b/src/DevHive.Web/Configurations/Extensions/ConfigureDatabase.cs
@@ -38,8 +38,6 @@ namespace DevHive.Web.Configurations.Extensions
options.Lockout.AllowedForNewUsers = true;
options.Lockout.DefaultLockoutTimeSpan = TimeSpan.FromMinutes(5);
options.Lockout.MaxFailedAccessAttempts = 5;
-
- options.Stores.MaxLengthForKeys = 20;
});
services.AddAuthorization(options =>
@@ -57,8 +55,6 @@ namespace DevHive.Web.Configurations.Extensions
options.AuthenticationSchemes.Add(JwtBearerDefaults.AuthenticationScheme);
options.RequireRole("Admin");
});
-
- // options.DefaultPolicy = ;
});
}