public async Task <IHttpActionResult> Get(string asin)
        {
            //var claimsPrinciple = User as ClaimsPrincipal;
            //var username = claimsPrinciple.FindFirst("").Value;

            MusicReleaseCollection musicReleaseDetailModel = null;

            try
            {
                musicReleaseDetailModel = _releaseSearch.GetDetails(asin);
            }
            catch (WebException ex)
            {
                return(InternalServerError());
            }

            if (musicReleaseDetailModel != null)
            {
                return(Ok(musicReleaseDetailModel));
            }
            else
            {
                return(InternalServerError());
            }
        }
Exemple #2
0
        public ActionResult Detail(string asin)
        {
            MusicReleaseCollection musicReleaseDetailModel = null;

            try
            {
                musicReleaseDetailModel = _releaseSearch.GetDetails(asin);
            }
            catch (WebException ex)
            {
                return(RedirectToAction("Index", "Error"));
            }

            if (musicReleaseDetailModel != null)
            {
                return(View(musicReleaseDetailModel));
            }
            else
            {
                return(RedirectToAction("Index", "Error"));
            }
        }
        public IActionResult Get(string asin)
        {
            var releaseSearch = new ReleaseSearch(_amazonItemRepo, _itunesItemRepo);
            MusicReleaseCollection musicReleaseDetailModel = null;

            try
            {
                musicReleaseDetailModel = releaseSearch.GetDetails(asin);
            }
            catch (WebException ex)
            {
                return(StatusCode(500, ex.Message));
            }

            if (musicReleaseDetailModel != null)
            {
                return(Ok(musicReleaseDetailModel));
            }
            else
            {
                return(StatusCode(500));
            }
        }