Beispiel #1
0
        private async Task <UserReference> UpdateUser(string id, string firstName, string lastName)
        {
            var dto = new UserAddUpdRequest {
                FirstName = firstName, LastName = lastName
            };
            var updatedRef = await _userCommandService.Update(id, dto);

            if (!updatedRef.IsSuccess)
            {
                throw new Exception("Failed to update a user");
            }

            await SaveChanges();

            return(updatedRef.Value);
        }
Beispiel #2
0
 public Task <ActionResult <UserReference> > Update([FromServices] IUserCommandService service,
                                                    [FromRoute] string id,
                                                    UserAddUpdRequest dto
                                                    )
 => service.Update(id, dto).ToActionResultOfT();