public HttpResponseMessage Get() { var pets = PetManager.GetPets(); return(new HttpResponseMessage(HttpStatusCode.OK) { Content = new StringContent(JsonConvert.SerializeObject(pets), System.Text.Encoding.UTF8, "application/json") }); }
public void RestorePet(string petID) { foreach (Pet pet in petManager.GetPets()) { if (pet.Identifier == petID && GetPlayer().HasPet(pet) == false) { GetPlayer().Pets.Add(pet); } } }
public HttpResponseMessage Get([FromUri] string nickName) { List <PetView> pets = new List <PetView>(); UserView user = UserManager.GetUser(nickName); if (user != null) { pets = PetManager.GetPets(new Guid(user.Id)); } return(new HttpResponseMessage(HttpStatusCode.OK) { Content = new StringContent(JsonConvert.SerializeObject(pets), System.Text.Encoding.UTF8, "application/json") }); }
public void GetPets() { _pets = _petManager.GetPets(); }