public async Task <IActionResult> Delete(int id) { var existingProfile = await profilesRepository.GetAsync(id); if (existingProfile == null) { return(NotFound()); } profilesRepository.Remove(id); return(Ok()); }