Exemple #1
0
        public async Task <IActionResult> UnlockProjectAsync(int projectId, [FromServices] IUnlockProjectCommand command)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            string user = User.Identity.Name;
            await command.ExecuteAsync(projectId, user);

            return(Ok());
        }
Exemple #2
0
        public async Task <IActionResult> UnlockProjectAsync(int projectId, [FromServices] IUnlockProjectCommand command)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            var userId = 1; // From identity
            await command.ExecuteAsync(projectId, userId);

            return(Ok());
        }