public void DeletePlanet(PlanetDeleteModel planetToDelete) { var entity = _ctx.Planets.Single(e => e.PlanetId == planetToDelete.PlanetId); _ctx.Planets.Remove(entity); _ctx.SaveChanges(); }
public IHttpActionResult Delete(PlanetDeleteModel planetToDelete) { var planetService = CreatePlanetService(); planetService.DeletePlanet(planetToDelete); return(Ok()); }