diff options
| -rw-r--r-- | src/DevHive.Data/Repositories/TechnologyRepository.cs | 19 | ||||
| -rw-r--r-- | src/DevHive.code-workspace | 45 |
2 files changed, 59 insertions, 5 deletions
diff --git a/src/DevHive.Data/Repositories/TechnologyRepository.cs b/src/DevHive.Data/Repositories/TechnologyRepository.cs index 2ed3a23..cc0e642 100644 --- a/src/DevHive.Data/Repositories/TechnologyRepository.cs +++ b/src/DevHive.Data/Repositories/TechnologyRepository.cs @@ -9,14 +9,16 @@ namespace DevHive.Data.Repositories { public abstract class TechnologyRepository : IRepository<Technology> { - private DevHiveContext _context; + private readonly DevHiveContext _context; public TechnologyRepository(DevHiveContext context) { this._context = context; } - //Create + #region Create + + public async Task<bool> AddAsync(Technology entity) { await this._context @@ -25,8 +27,10 @@ namespace DevHive.Data.Repositories return await RepositoryMethods.SaveChangesAsync(this._context); } + #endregion + + #region Read - //Read public async Task<Technology> GetByIdAsync(Guid id) { return await this._context @@ -49,8 +53,10 @@ namespace DevHive.Data.Repositories .AsNoTracking() .AnyAsync(r => r.Id == id); } + #endregion + + #region Edit - //Edit public async Task<bool> EditAsync(Technology newEntity) { this._context @@ -59,8 +65,10 @@ namespace DevHive.Data.Repositories return await RepositoryMethods.SaveChangesAsync(this._context); } + #endregion + + #region Delete - //Delete public async Task<bool> DeleteAsync(Technology entity) { this._context @@ -69,5 +77,6 @@ namespace DevHive.Data.Repositories return await RepositoryMethods.SaveChangesAsync(this._context); } + #endregion } }
\ No newline at end of file diff --git a/src/DevHive.code-workspace b/src/DevHive.code-workspace index e1472d3..8899918 100644 --- a/src/DevHive.code-workspace +++ b/src/DevHive.code-workspace @@ -38,5 +38,50 @@ }, "code-runner.fileDirectoryAsCwd": true, "compile-hero.disable-compile-files-on-did-save-code": true + }, + "launch": { + "configurations": [ + { + "name": ".NET Core Launch (web)", + "type": "coreclr", + "request": "launch", + "preLaunchTask": "workspace-build", + "program": "${workspaceFolder:DevHive.Web}/bin/Debug/net5.0/DevHive.Web.dll", + "args": [], + "cwd": "${workspaceFolder:DevHive.Web}", + "stopAtEntry": false, + "serverReadyAction": { + "action": "openExternally", + "pattern": "\\bNow listening on:\\s+(https?://\\S+)" + }, + "env": { + "ASPNETCORE_ENVIRONMENT": "Development" + }, + }, + ], + "compounds": [] + }, + "tasks": { + "version": "2.0.0", + "tasks": [ + { + "label": "workspace-build", + "command": "dotnet", + "type": "shell", + "args": [ + "build", + "/property:GenerateFullPaths=true", + "/consoleloggerparameters:NoSummary" + ], + "group": { + "kind": "build", + "isDefault": true + }, + "presentation": { + "reveal": "silent" + }, + "problemMatcher": "$msCompile" + } + ] } } |
