From 1bf2b4a03197743efc95f8df08e3b0ae1260f759 Mon Sep 17 00:00:00 2001 From: transtrike Date: Tue, 15 Dec 2020 21:51:20 +0200 Subject: Renamed _service to _*func*Service --- src/DevHive.Web/Controllers/RoleController.cs | 14 +++++++------- src/DevHive.Web/Controllers/UserController.cs | 14 +++++++------- 2 files changed, 14 insertions(+), 14 deletions(-) (limited to 'src/DevHive.Web') diff --git a/src/DevHive.Web/Controllers/RoleController.cs b/src/DevHive.Web/Controllers/RoleController.cs index fb26594..15db95d 100644 --- a/src/DevHive.Web/Controllers/RoleController.cs +++ b/src/DevHive.Web/Controllers/RoleController.cs @@ -13,12 +13,12 @@ namespace DevHive.Web.Controllers [Route("/api/[controller]")] public class RoleController { - private readonly RoleService _service; + private readonly RoleService _roleService; private readonly IMapper _roleMapper; public RoleController(DevHiveContext context, IMapper mapper) { - this._service = new RoleService(context, mapper); + this._roleService = new RoleService(context, mapper); } [HttpPost] @@ -27,13 +27,13 @@ namespace DevHive.Web.Controllers RoleServiceModel roleServiceModel = this._roleMapper.Map(createRoleWebModel); - return this._service.CreateRole(roleServiceModel); + return this._roleService.CreateRole(roleServiceModel); } [HttpGet] - public Task Get(Guid id) + public Task GetById(Guid id) { - return this._service.GetRoleById(id); + return this._roleService.GetRoleById(id); } [HttpPut] @@ -42,13 +42,13 @@ namespace DevHive.Web.Controllers RoleServiceModel roleServiceModel = this._roleMapper.Map(updateRoleWebModel); - return this._service.UpdateRole(roleServiceModel); + return this._roleService.UpdateRole(roleServiceModel); } [HttpDelete] public Task Delete(Guid id) { - return this._service.DeleteRole(id); + return this._roleService.DeleteRole(id); } } } diff --git a/src/DevHive.Web/Controllers/UserController.cs b/src/DevHive.Web/Controllers/UserController.cs index 900af42..f241409 100644 --- a/src/DevHive.Web/Controllers/UserController.cs +++ b/src/DevHive.Web/Controllers/UserController.cs @@ -15,12 +15,12 @@ namespace DevHive.Web.Controllers [Route("/api/[controller]")] public class UserController: ControllerBase { - private readonly UserService _service; + private readonly UserService _userService; private readonly IMapper _userMapper; public UserController(DevHiveContext context, IMapper mapper, JWTOptions jwtOptions) { - this._service = new UserService(context, mapper, jwtOptions); + this._userService = new UserService(context, mapper, jwtOptions); this._userMapper = mapper; } @@ -30,7 +30,7 @@ namespace DevHive.Web.Controllers { LoginServiceModel loginServiceModel = this._userMapper.Map(loginModel); - return await this._service.LoginUser(loginServiceModel); + return await this._userService.LoginUser(loginServiceModel); } [HttpPost] @@ -39,14 +39,14 @@ namespace DevHive.Web.Controllers { RegisterServiceModel registerServiceModel = this._userMapper.Map(registerModel); - return await this._service.RegisterUser(registerServiceModel); + return await this._userService.RegisterUser(registerServiceModel); } //Read [HttpGet] public async Task GetById(Guid id) { - return await this._service.GetUserById(id); + return await this._userService.GetUserById(id); } //Update @@ -57,7 +57,7 @@ namespace DevHive.Web.Controllers UpdateUserServiceModel updateUserServiceModel = this._userMapper.Map(updateModel); updateUserServiceModel.Id = id; - return await this._service.UpdateUser(updateUserServiceModel); + return await this._userService.UpdateUser(updateUserServiceModel); } //Delete @@ -65,7 +65,7 @@ namespace DevHive.Web.Controllers [Authorize] public async Task Delete(Guid id) { - return await this._service.DeleteUser(id); + return await this._userService.DeleteUser(id); } } } -- cgit v1.2.3 From 791c559712a161c745a407a87d0f7e8d1f00492c Mon Sep 17 00:00:00 2001 From: transtrike Date: Tue, 15 Dec 2020 21:56:11 +0200 Subject: Updated packages to latest --- src/DevHive.Data/DevHive.Data.csproj | 2 +- src/DevHive.Data/Repositories/DevHiveContext.cs | 3 +-- src/DevHive.Web/DevHive.Web.csproj | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) (limited to 'src/DevHive.Web') diff --git a/src/DevHive.Data/DevHive.Data.csproj b/src/DevHive.Data/DevHive.Data.csproj index d7d59c0..d472d1c 100644 --- a/src/DevHive.Data/DevHive.Data.csproj +++ b/src/DevHive.Data/DevHive.Data.csproj @@ -8,7 +8,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/DevHive.Data/Repositories/DevHiveContext.cs b/src/DevHive.Data/Repositories/DevHiveContext.cs index dad4672..2f0fa55 100644 --- a/src/DevHive.Data/Repositories/DevHiveContext.cs +++ b/src/DevHive.Data/Repositories/DevHiveContext.cs @@ -1,12 +1,11 @@ using System; using DevHive.Data.Models; -using Microsoft.AspNetCore.Identity; using Microsoft.AspNetCore.Identity.EntityFrameworkCore; using Microsoft.EntityFrameworkCore; namespace DevHive.Data.Repositories { - public class DevHiveContext : IdentityDbContext, Guid> + public class DevHiveContext : IdentityDbContext { public DevHiveContext(DbContextOptions options) : base(options) { } diff --git a/src/DevHive.Web/DevHive.Web.csproj b/src/DevHive.Web/DevHive.Web.csproj index 5b5478d..7f7ba49 100644 --- a/src/DevHive.Web/DevHive.Web.csproj +++ b/src/DevHive.Web/DevHive.Web.csproj @@ -6,7 +6,7 @@ - + -- cgit v1.2.3