public IActionResult GetContact_WithCard(string contact_IdentityCardNum) { try { if (contact_IdentityCardNum == null) //If the Identity Card Number is not specified... { return(Ok(ContactsRepo.GetAllContactsWithCards())); //Return all contacts... } return(Ok(ContactsRepo.GetContactWithCard(contact_IdentityCardNum))); //Return specific contact... } catch (Exception e) { return(StatusCode(500, _config["StatusCodesText:ServerErr"])); } }