public async Task <ActionResult <Profile> > DeleteProfile(int id) { try { var result = await _profileRepository.DeleteProfileAsync(id); if (result != null) { return(null); } return(result); } catch (Exception) { return(StatusCode(StatusCodes.Status500InternalServerError, "Error retrieving data from the database.")); } }