public void DeletePlanet(PlanetDeleteModel planetToDelete)
        {
            var entity = _ctx.Planets.Single(e => e.PlanetId == planetToDelete.PlanetId);

            _ctx.Planets.Remove(entity);
            _ctx.SaveChanges();
        }
Exemple #2
0
        public IHttpActionResult Delete(PlanetDeleteModel planetToDelete)
        {
            var planetService = CreatePlanetService();

            planetService.DeletePlanet(planetToDelete);
            return(Ok());
        }