public Response RemoveCarType(int id) { Response response = new Response(); if (carTypeRepository.GetAll().FirstOrDefault() == null) { response.Success = false; response.Message = "ERROR: no TypeRepository found"; } else if (carTypeRepository.GetAll().All(t => t.CarTypeId != id)) { response.Success = false; response.Message = "ERROR: no TypeRepository found with id=" + id; } else { carTypeRepository.Remove(id); response.Success = true; response.Message = "TypeRepository removed"; } return(response); }