diff options
Diffstat (limited to 'src/DevHive.Data/Repositories/LanguageRepository.cs')
| -rw-r--r-- | src/DevHive.Data/Repositories/LanguageRepository.cs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/DevHive.Data/Repositories/LanguageRepository.cs b/src/DevHive.Data/Repositories/LanguageRepository.cs index 108b307..4c51cf3 100644 --- a/src/DevHive.Data/Repositories/LanguageRepository.cs +++ b/src/DevHive.Data/Repositories/LanguageRepository.cs @@ -20,8 +20,7 @@ namespace DevHive.Data.Repositories public async Task<bool> AddAsync(Language entity) { - await this._context - .Set<Language>() + await this._context.Languages .AddAsync(entity); return await this.SaveChangesAsync(this._context); @@ -32,14 +31,14 @@ namespace DevHive.Data.Repositories public async Task<Language> GetByIdAsync(Guid id) { - return await this._context - .Set<Language>() + return await this._context.Languages .FindAsync(id); } public async Task<Language> GetByNameAsync(string languageName) { return await this._context.Languages + .AsNoTracking() .FirstOrDefaultAsync(x => x.Name == languageName); } #endregion |
