Example #1
0
        public ActionResult DeleteApartment(int id)
        {
            var modelFromRepo = _repo.GetResidentByID(id);

            if (modelFromRepo == null)
            {
                return(NotFound());
            }

            _repo.DeleteResident(modelFromRepo);
            _repo.SaveChanges();
            return(NoContent());
        }
Example #2
0
 public async Task DeleteResident(int residentId) =>
 await _repo.DeleteResident(residentId);