diff options
Diffstat (limited to 'src/DevHive.Common')
| -rw-r--r-- | src/DevHive.Common/DevHive.Common.csproj | 12 | ||||
| -rw-r--r-- | src/DevHive.Common/Models/Data/RepositoryMethods.cs | 15 | ||||
| -rw-r--r-- | src/DevHive.Common/Models/Identity/TokenModel.cs | 12 |
3 files changed, 39 insertions, 0 deletions
diff --git a/src/DevHive.Common/DevHive.Common.csproj b/src/DevHive.Common/DevHive.Common.csproj new file mode 100644 index 0000000..1aca8a6 --- /dev/null +++ b/src/DevHive.Common/DevHive.Common.csproj @@ -0,0 +1,12 @@ +<Project Sdk="Microsoft.NET.Sdk">
+
+ <PropertyGroup>
+ <TargetFramework>net5.0</TargetFramework>
+ </PropertyGroup>
+
+<ItemGroup>
+ <PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="5.0.1" />
+</ItemGroup>
+
+
+</Project>
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 |
