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/TokenModel.cs12
2 files changed, 27 insertions, 0 deletions
diff --git a/src/DevHive.Common/Models/Data/RepositoryMethods.cs b/src/DevHive.Common/Models/Data/RepositoryMethods.cs
new file mode 100644
index 0000000..b56aad9
--- /dev/null
+++ b/src/DevHive.Common/Models/Data/RepositoryMethods.cs
@@ -0,0 +1,15 @@
+using System.Threading.Tasks;
+using Microsoft.EntityFrameworkCore;
+
+namespace DevHive.Common.Models.Data
+{
+ 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/TokenModel.cs b/src/DevHive.Common/Models/Identity/TokenModel.cs
new file mode 100644
index 0000000..0fb6c82
--- /dev/null
+++ b/src/DevHive.Common/Models/Identity/TokenModel.cs
@@ -0,0 +1,12 @@
+namespace DevHive.Common.Models.Identity
+{
+ public class TokenModel
+ {
+ public TokenModel(string token)
+ {
+ this.Token = token;
+ }
+
+ public string Token { get; set; }
+ }
+} \ No newline at end of file