public Animal CreateCat(Shelter.Shared.Cat cat) { var newCat = new Cat { name = cat.name, DateOfBirth = cat.DateOfBirth, IsChecked = cat.IsChecked, KidFriendly = cat.KidFriendly, DateOfArrival = cat.DateOfArrival, ShelterId = cat.ShelterId, Declawed = cat.Declawed, Race = cat.Race }; _context.Add(newCat); _context.SaveChanges(); return(newCat); }
//[Authorize] //Create an cat public IActionResult DoCreateCat(Shelter.Shared.Cat cat) { Animal createdAnimal = _dataAccess.CreateCat(cat); return(createdAnimal == default(Shared.Animal) ? (IActionResult)NotFound("No animal found with these parameters") : Ok(createdAnimal)); }