public BaseResponse <LabelOutputDto> Create(LabelInputDto labelInputDto, Guid id) { var label = Create(Mapper.Map <Label>(labelInputDto), out var isSaved); if (!isSaved) { throw new InternalServerErrorException("Could not create label"); } return(new SuccessResponse <LabelOutputDto>(Mapper.Map <LabelOutputDto>(label))); }
public BaseResponse <bool> Update(Guid id, LabelInputDto labelInputDto) { var label = Mapper.Map <Label>(labelInputDto); label.Id = id; var isSaved = Update(label); if (!isSaved) { throw new InternalServerErrorException("Could not create label"); } return(new SuccessResponse <bool>(true)); }
public BaseResponse <bool> Update(Guid id, [FromBody] LabelInputDto labelInputDto) { return(_labelService.Update(id, labelInputDto)); }
public BaseResponse <LabelOutputDto> Create([FromBody] LabelInputDto labelInputDto) { var userId = User.GetUserId(); return(_labelService.Create(labelInputDto, userId)); }