aboutsummaryrefslogtreecommitdiff
path: root/src/DevHive.Common/Models
diff options
context:
space:
mode:
Diffstat (limited to 'src/DevHive.Common/Models')
-rw-r--r--src/DevHive.Common/Models/Data/RepositoryMethods.cs15
-rw-r--r--src/DevHive.Common/Models/Identity/RoleModel.cs10
-rw-r--r--src/DevHive.Common/Models/Misc/PasswordModifications.cs13
-rw-r--r--src/DevHive.Common/Models/Misc/Patch.cs9
4 files changed, 22 insertions, 25 deletions
diff --git a/src/DevHive.Common/Models/Data/RepositoryMethods.cs b/src/DevHive.Common/Models/Data/RepositoryMethods.cs
deleted file mode 100644
index bfd057f..0000000
--- a/src/DevHive.Common/Models/Data/RepositoryMethods.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-using System.Threading.Tasks;
-using Microsoft.EntityFrameworkCore;
-
-namespace DevHive.Common.Models.Misc
-{
- public static class RepositoryMethods
- {
- public static async Task<bool> SaveChangesAsync(DbContext context)
- {
- int result = await context.SaveChangesAsync();
-
- return result >= 1;
- }
- }
-} \ No newline at end of file
diff --git a/src/DevHive.Common/Models/Identity/RoleModel.cs b/src/DevHive.Common/Models/Identity/RoleModel.cs
deleted file mode 100644
index 5db8df9..0000000
--- a/src/DevHive.Common/Models/Identity/RoleModel.cs
+++ /dev/null
@@ -1,10 +0,0 @@
-using System;
-
-namespace DevHive.Common.Models.Identity
-{
- public class RoleModel
- {
- public Guid Id { get; set; }
- public string Name { get; set; }
- }
-}
diff --git a/src/DevHive.Common/Models/Misc/PasswordModifications.cs b/src/DevHive.Common/Models/Misc/PasswordModifications.cs
new file mode 100644
index 0000000..f10a334
--- /dev/null
+++ b/src/DevHive.Common/Models/Misc/PasswordModifications.cs
@@ -0,0 +1,13 @@
+using System.Security.Cryptography;
+using System.Text;
+
+namespace DevHive.Common.Models.Misc
+{
+ public static class PasswordModifications
+ {
+ public static string GeneratePasswordHash(string password)
+ {
+ return string.Join(string.Empty, SHA512.HashData(Encoding.ASCII.GetBytes(password)));
+ }
+ }
+}
diff --git a/src/DevHive.Common/Models/Misc/Patch.cs b/src/DevHive.Common/Models/Misc/Patch.cs
new file mode 100644
index 0000000..ea5a4f1
--- /dev/null
+++ b/src/DevHive.Common/Models/Misc/Patch.cs
@@ -0,0 +1,9 @@
+namespace DevHive.Common.Models.Misc
+{
+ public class Patch
+ {
+ public string Name { get; set; }
+ public object Value { get; set; }
+ public string Action { get; set; }
+ }
+}