Changeset aed1148 for iknow-api/Controllers/UsersControllers.cs
- Timestamp:
- 10/22/25 13:20:23 (11 months ago)
- Branches:
- master
- Children:
- fc7b4b4
- Parents:
- c0a75ab (diff), 9694de9 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)links above to see all the changes relative to each parent. - File:
-
- 1 edited
-
iknow-api/Controllers/UsersControllers.cs (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
iknow-api/Controllers/UsersControllers.cs
rc0a75ab raed1148 1 //using iknow_api.Data; 2 using iknow_api.Models; 1 using iknow_api.Core.Models; 3 2 using System.Threading.Tasks; 4 3 using Microsoft.AspNetCore.Mvc; 5 4 using iknow_api.Core.Data; 5 using iknow_api.Repository.Interfaces; 6 using iknow_api.Core.Interfaces; 6 7 7 8 namespace iknow_api.Controllers … … 11 12 public class UsersController : ControllerBase 12 13 { 13 private readonly AppDbContext _context; 14 private readonly IConfiguration _configuration; 14 private readonly IUserService _users; 15 15 16 public UsersController( AppDbContext context, IConfiguration configuration)16 public UsersController(IUserService users) 17 17 { 18 _context = context; 19 _configuration = configuration; 18 _users = users; 20 19 } 21 20 22 21 [HttpPost("add")] 23 public async Task<IActionResult> Add([FromBody] JsonContent body)22 public async Task<IActionResult> Add([FromBody] User user) 24 23 { 25 26 return null;24 var created = await _users.AddUserAsync(user); 25 return Ok(created); 27 26 } 28 27 28 [HttpGet("id/{id}")] 29 public async Task<IActionResult> GetById(int id) 30 { 31 var user = await _users.GetUserByIdAsync(id); 32 if (user == null) 33 return NotFound(); 34 return Ok(user); 35 } 29 36 } 30 37 }
Note:
See TracChangeset
for help on using the changeset viewer.
