コード例 #1
0
        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 }));
        }
コード例 #2
0
        public async Task <ActionResult> Update(Guid id, UpdateFriendLinkCommand command)
        {
            if (id != command.Id)
            {
                return(BadRequest());
            }

            await Mediator.Send(command);

            return(NoContent());
        }