From 33b5f6297c2c975bec8a74a8facc208261c03c9e Mon Sep 17 00:00:00 2001 From: transtrike Date: Tue, 19 Jan 2021 20:36:39 +0200 Subject: Replaced RepoMethods with BaseClass and inherited it where needed --- src/DevHive.Data/Repositories/PostRepository.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/DevHive.Data/Repositories/PostRepository.cs') 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() .AddAsync(post); - return await RepositoryMethods.SaveChangesAsync(this._context); + return await this.SaveChangesAsync(this._context); } public async Task AddCommentAsync(Comment entity) @@ -32,7 +32,7 @@ namespace DevHive.Data.Repositories .Set() .AddAsync(entity); - return await RepositoryMethods.SaveChangesAsync(this._context); + return await this.SaveChangesAsync(this._context); } //Read @@ -71,7 +71,7 @@ namespace DevHive.Data.Repositories .Set() .Update(newPost); - return await RepositoryMethods.SaveChangesAsync(this._context); + return await this.SaveChangesAsync(this._context); } public async Task EditCommentAsync(Comment newEntity) @@ -80,7 +80,7 @@ namespace DevHive.Data.Repositories .Set() .Update(newEntity); - return await RepositoryMethods.SaveChangesAsync(this._context); + return await this.SaveChangesAsync(this._context); } //Delete @@ -90,7 +90,7 @@ namespace DevHive.Data.Repositories .Set() .Remove(post); - return await RepositoryMethods.SaveChangesAsync(this._context); + return await this.SaveChangesAsync(this._context); } public async Task DeleteCommentAsync(Comment entity) @@ -99,7 +99,7 @@ namespace DevHive.Data.Repositories .Set() .Remove(entity); - return await RepositoryMethods.SaveChangesAsync(this._context); + return await this.SaveChangesAsync(this._context); } #region Validations -- cgit v1.2.3