Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public abstract class BaseController : ControllerBase
- {
- public int LoggedInUserId
- {
- get
- {
- Task<int> task = Task.Run(async () => await GetLoggedInUserId());
- return task.Result;
- }
- }
- }
- [Route("api/[controller]")]
- [ApiController]
- public class UsersController : BaseController
- {
- public UsersController()
- {
- }
- [HttpPost("create")]
- public async Task<ActionResult<User>> Create([FromBody] userCreate)
- {
- _userService.CreateUser(userCreate, LoggedInUserId);
- }
- }
- _userService.CreateUser(userCreate, await GetLoggedInUserId());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement