private Response GetHero(string name) { Hero hero = heroes.GetHero(name); if (hero != null) { return(Response.AsJson <Hero>(hero)); } else { return(new NotFoundResponse()); } }
public Hero GetHero(string name) { Hero hero = heroes.GetHero(name); if (hero == null) { WebOperationContext.Current.OutgoingResponse.SetStatusAsNotFound(); } return(hero); }