public CommandResult Handle(UpdateFriendLinkCommand command) { var entity = _repo.Get(x => x.Id == command.Id); _mapper.Map(command, entity); return(_repo.Update(entity, r => new object[] { entity.Id })); }
public async Task <ActionResult> Update(Guid id, UpdateFriendLinkCommand command) { if (id != command.Id) { return(BadRequest()); } await Mediator.Send(command); return(NoContent()); }