public IHttpActionResult GetTagsByImage(int id) { var tags = _hashTagService.GetHashTagsByImage(id); if (tags != null) { return(Ok(tags)); } return(new HttpActionResult(HttpStatusCode.NoContent)); }
public IHttpActionResult GetImageModelById(int id) { ImageDTO dto = _imageService.GetImageById(id); if (dto == null) { return(new HttpActionResult(HttpStatusCode.NoContent)); } return(Ok(new ImagePostModel { Id = dto.Id, Title = dto.Title, FileId = dto.ImageFileId, ProfileId = dto.ProfileId, HashTags = _hashTagService.GetHashTagsByImage(dto.Id) .Select(x => x.Name).ToList(), AvgMark = _imageService.GetAverageMarkByImage(dto.Id) })); }