예제 #1
0
        public async Task <IActionResult> DeleteUser([FromRoute] string userId)
        {
            var exists = await _context.AppUsers.AnyAsync(usr => usr.Id == userId);

            if (!exists)
            {
                return(NotFound());
            }

            await _appUsersService.Delete(userId);

            var links = new List <Link>
            {
                LinkGenerator.Users.Delete(userId, "self"),
                LinkGenerator.Users.GetAll()
            };

            return(Ok(new HALResponse(null).AddLinks(links)));
        }