예제 #1
0
        public async Task <IActionResult> Get(string id)
        {
            using (var ct = new MoviesDataController())
            {
                Guid guid;
                if (!Guid.TryParse(id, out guid)) // validates id is a guid
                {
                    return(StatusCode((int)System.Net.HttpStatusCode.ExpectationFailed));
                }

                return(Ok(await ct.GetMovieAsync(guid)));
            }
        }