private async void DoSaveUsers(object obj) { Loading = true; if (Workflows != null) { if (Workflows.Where(w => w.IsValid == YesNo.No.ToString()).Any()) { Loading = false; MessageBox.Show("You have some query workflows which are not valid. Please verify . ."); return; } List <QueryWorkflowUserDTO> dtos = new List <QueryWorkflowUserDTO>(); foreach (var workflow in Workflows) { QueryWorkflowUserDTO dto = new QueryWorkflowUserDTO(); dto.L1User = workflow.L1user; dto.L2User = workflow.L2user; dto.L3User = workflow.L3user; dto.L4User = workflow.L4user; dto.L5User = workflow.L5user; dtos.Add(dto); } var result = await RestHub.SaveQueryWorkflows(dtos); if (result.StatusMessage != null) { MessageBox.Show(result.StatusMessage); Refresh.Execute(this); } else { MessageBox.Show("Can't Save Workflows . ."); } } Loading = false; }