public async Task <IActionResult> Index() { var model = new ProtocolIndexModel(); model.Protocols = await _protocolsService.GetAllProtocolsForDepartmentAsync(DepartmentId); return(View(model)); }
public async Task <ActionResult <List <ProtocolResult> > > GetAllProtocols() { var results = new List <ProtocolResult>(); var department = await _departmentsService.GetDepartmentByIdAsync(DepartmentId, false); var protocols = await _protocolsService.GetAllProtocolsForDepartmentAsync(DepartmentId); foreach (var p in protocols) { results.Add(ProtocolResult.Convert(p)); } return(Ok(results)); }