private Response GetHero(string name)
        {
            Hero hero = heroes.GetHero(name);

            if (hero != null)
            {
                return(Response.AsJson <Hero>(hero));
            }
            else
            {
                return(new NotFoundResponse());
            }
        }
Beispiel #2
0
        public Hero GetHero(string name)
        {
            Hero hero = heroes.GetHero(name);

            if (hero == null)
            {
                WebOperationContext.Current.OutgoingResponse.SetStatusAsNotFound();
            }

            return(hero);
        }