public async Task <IActionResult> GetSurveysForEmployee(int employeeId = 0) { if (!employeeContext.EmployeeExists(employeeId)) { return(BadRequest("Invalid. Employee Id doesn't exists !")); } List <Survey> surveys = await surveyContext.GetEmployeeSurveys(employeeId); // Convert all Survey Ent to SurveyViewModels List <SurveyViewModel> surveyVMList = surveys.ConvertAll <SurveyViewModel>(s => new SurveyViewModel(s)); surveys = null; return(Ok(surveyVMList)); }