Advertisement
Guest User

Untitled

a guest
Jun 15th, 2019
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. public abstract class BaseController : ControllerBase
  2. {
  3. public int LoggedInUserId
  4. {
  5. get
  6. {
  7. Task<int> task = Task.Run(async () => await GetLoggedInUserId());
  8. return task.Result;
  9. }
  10. }
  11. }
  12.  
  13. [Route("api/[controller]")]
  14. [ApiController]
  15. public class UsersController : BaseController
  16. {
  17. public UsersController()
  18. {
  19.  
  20. }
  21.  
  22. [HttpPost("create")]
  23. public async Task<ActionResult<User>> Create([FromBody] userCreate)
  24. {
  25. _userService.CreateUser(userCreate, LoggedInUserId);
  26. }
  27. }
  28.  
  29. _userService.CreateUser(userCreate, await GetLoggedInUserId());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement