aboutsummaryrefslogtreecommitdiff
path: root/src/DevHive.Data/Repositories/LanguageRepository.cs
diff options
context:
space:
mode:
authortranstrike <transtrike@gmail.com>2021-01-21 19:41:28 +0200
committertranstrike <transtrike@gmail.com>2021-01-21 19:41:28 +0200
commit58178d5036f65bb4896fea08bbec9388a8ab8c20 (patch)
treec4e7656a526cc128f7d0e680648e932f16b5f47a /src/DevHive.Data/Repositories/LanguageRepository.cs
parentf8f3727319a03eb9dd9a2ed8546810beb732cdab (diff)
downloadDevHive-58178d5036f65bb4896fea08bbec9388a8ab8c20.tar
DevHive-58178d5036f65bb4896fea08bbec9388a8ab8c20.tar.gz
DevHive-58178d5036f65bb4896fea08bbec9388a8ab8c20.zip
Code cleanup & consistency
Diffstat (limited to 'src/DevHive.Data/Repositories/LanguageRepository.cs')
-rw-r--r--src/DevHive.Data/Repositories/LanguageRepository.cs12
1 files changed, 2 insertions, 10 deletions
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<bool> AddAsync(Language entity)
{
await this._context.Languages
@@ -28,7 +27,6 @@ namespace DevHive.Data.Repositories
#endregion
#region Read
-
public async Task<Language> GetByIdAsync(Guid id)
{
return await this._context.Languages
@@ -47,28 +45,22 @@ namespace DevHive.Data.Repositories
public async Task<bool> EditAsync(Language newEntity)
{
- this._context
- .Set<Language>()
- .Update(newEntity);
+ this._context.Languages.Update(newEntity);
return await this.SaveChangesAsync(this._context);
}
#endregion
#region Delete
-
public async Task<bool> DeleteAsync(Language entity)
{
- this._context
- .Set<Language>()
- .Remove(entity);
+ this._context.Languages.Remove(entity);
return await this.SaveChangesAsync(this._context);
}
#endregion
#region Validations
-
public async Task<bool> DoesLanguageNameExistAsync(string languageName)
{
return await this._context.Languages