From 58178d5036f65bb4896fea08bbec9388a8ab8c20 Mon Sep 17 00:00:00 2001 From: transtrike Date: Thu, 21 Jan 2021 19:41:28 +0200 Subject: Code cleanup & consistency --- src/DevHive.Data/Repositories/LanguageRepository.cs | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'src/DevHive.Data/Repositories/LanguageRepository.cs') diff --git a/src/DevHive.Data/Repositories/LanguageRepository.cs b/src/DevHive.Data/Repositories/LanguageRepository.cs index 4c51cf3..491019c 100644 --- a/src/DevHive.Data/Repositories/LanguageRepository.cs +++ b/src/DevHive.Data/Repositories/LanguageRepository.cs @@ -17,7 +17,6 @@ namespace DevHive.Data.Repositories } #region Create - public async Task AddAsync(Language entity) { await this._context.Languages @@ -28,7 +27,6 @@ namespace DevHive.Data.Repositories #endregion #region Read - public async Task GetByIdAsync(Guid id) { return await this._context.Languages @@ -47,28 +45,22 @@ namespace DevHive.Data.Repositories public async Task EditAsync(Language newEntity) { - this._context - .Set() - .Update(newEntity); + this._context.Languages.Update(newEntity); return await this.SaveChangesAsync(this._context); } #endregion #region Delete - public async Task DeleteAsync(Language entity) { - this._context - .Set() - .Remove(entity); + this._context.Languages.Remove(entity); return await this.SaveChangesAsync(this._context); } #endregion #region Validations - public async Task DoesLanguageNameExistAsync(string languageName) { return await this._context.Languages -- cgit v1.2.3