public IActionResult RestoreDelAddressTypes(int Id, bool del) { var addressT = _addTypeRepo.GetAddressType(Id); if (addressT == null) { return(new NotFoundResult()); } else { _addTypeRepo.AssignAddressTypeDeletedRestored(Id, del); var addressT2 = _addTypeRepo.getDeletedAddressTypes(false); if (addressT2 == null) { return(new NotFoundResult()); } else { var addressRecords = _addTypeRepo.getDeletedAddressTypes(false); var addresstypesVm = AddressTypeViewModel.MultipleAccTypesMap(addressRecords); return(new OkObjectResult(addresstypesVm)); } } }