Beispiel #1
0
        public IHttpActionResult GetByFullName(string name)
        {
            var tag = _hashTagService.GetHashTagByName(name);

            if (tag != null)
            {
                return(Ok(tag));
            }
            return(new HttpActionResult(HttpStatusCode.NoContent));
        }
        public IHttpActionResult GetImagesByHashTag(string tag)
        {
            int?tagId = _hashTagService.GetHashTagByName(tag)?.Id;

            if (tagId == null)
            {
                return(BadRequest("Name must be not empty."));
            }
            var images = _imageService.GetImagesByHashTag(tagId.Value);

            if (images == null)
            {
                return(new HttpActionResult(HttpStatusCode.NoContent));
            }
            return(Ok(images));
        }