Website Summary Files Commits Branches @commit @diff @stats
path: root / src / DevHive.Data / Repositories / PostRepository.cs
diff options
context:
space:
mode:
Commit33b5f6297c2c975bec8a74a8facc208261c03c9e (patch)
Author
 transtrike <transtrike@gmail.com>
2021-01-19 20:36:39 +0200
Committer
 transtrike <transtrike@gmail.com>
2021-01-19 20:36:39 +0200
Files20593ba74065681cd86ce852a65f3efc1dc0036b /src/DevHive.Data/Repositories/PostRepository.cs
DevHive-33b5f6297c2c975bec8a74a8facc208261c03c9e.tar
DevHive-33b5f6297c2c975bec8a74a8facc208261c03c9e.tar.gz
DevHive-33b5f6297c2c975bec8a74a8facc208261c03c9e.zip
Parentc96a880768d8dee9449aa4f69e14bddc8e0d92f9 (diff)
Replaced RepoMethods with BaseClass and inherited it where needed
1 files changed, 7 insertions, 7 deletions
-rw-r--r--src/DevHive.Data/Repositories/PostRepository.cs14
diff --git a/src/DevHive.Data/Repositories/PostRepository.cs b/src/DevHive.Data/Repositories/PostRepository.cs
index c5e8569..db2c4af 100644
--- a/src/DevHive.Data/Repositories/PostRepository.cs
+++ b/src/DevHive.Data/Repositories/PostRepository.cs
@@ -7,7 +7,7 @@ using Microsoft.EntityFrameworkCore;
namespace DevHive.Data.Repositories
{
- public class PostRepository : IPostRepository
+ public class PostRepository : BaseRepository, IPostRepository
{
private readonly DevHiveContext _context;
@@ -23,7 +23,7 @@ namespace DevHive.Data.Repositories
.Set<Post>()
.AddAsync(post);
- return await RepositoryMethods.SaveChangesAsync(this._context);
+ return await this.SaveChangesAsync(this._context);
}
public async Task<bool> AddCommentAsync(Comment entity)
@@ -32,7 +32,7 @@ namespace DevHive.Data.Repositories
.Set<Comment>()
.AddAsync(entity);
- return await RepositoryMethods.SaveChangesAsync(this._context);
+ return await this.SaveChangesAsync(this._context);
}
//Read
@@ -71,7 +71,7 @@ namespace DevHive.Data.Repositories
.Set<Post>()
.Update(newPost);
- return await RepositoryMethods.SaveChangesAsync(this._context);
+ return await this.SaveChangesAsync(this._context);
}
public async Task<bool> EditCommentAsync(Comment newEntity)
@@ -80,7 +80,7 @@ namespace DevHive.Data.Repositories
.Set<Comment>()
.Update(newEntity);
- return await RepositoryMethods.SaveChangesAsync(this._context);
+ return await this.SaveChangesAsync(this._context);
}
//Delete
@@ -90,7 +90,7 @@ namespace DevHive.Data.Repositories
.Set<Post>()
.Remove(post);
- return await RepositoryMethods.SaveChangesAsync(this._context);
+ return await this.SaveChangesAsync(this._context);
}
public async Task<bool> DeleteCommentAsync(Comment entity)
@@ -99,7 +99,7 @@ namespace DevHive.Data.Repositories
.Set<Comment>()
.Remove(entity);
- return await RepositoryMethods.SaveChangesAsync(this._context);
+ return await this.SaveChangesAsync(this._context);
}
#region Validations