public IActionResult DoctorsForUser(int professionId) { try { return(View(_commonServices.GetAllDoctors().Where(d => d.IsApproved) .Join(_commonServices.GetAllProfessions(), d => d.ProfessionId, p => p.Id, (doctor, profession) => new DoctorScheduleProfessionForTablesViewModel(doctor, profession)) .Where(d => d.Profession.Id == professionId))); } catch (Exception ex) { return(View("Error")); } }
public ControllerResponse <IEnumerable <ProfessionDto> > GetAllProfessions() { return(ControllerResponse <IEnumerable <ProfessionDto> > .Ok(_commonServices.GetAllProfessions() .Select(p => new ProfessionDto(p)))); }