File tree Expand file tree Collapse file tree
DocuSign.Workspaces/DocuSign.Workspaces/Domain/CarePlans Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -20,17 +20,19 @@ public async Task<List<PhysicianModel>> GetPhysician()
2020 var workspaces = await docuSignApiProvider . Workspace2 . GetWorkspacesAsync ( accountRepository . AccountId ) ;
2121 if ( workspaces . Workspaces != null || workspaces . Workspaces ? . Count != 0 )
2222 {
23- var physician = workspaces . Workspaces
24- ? . Where ( a => physicians . Contains ( a . Name + " Workspace" ) )
23+ var createdPhysician = workspaces . Workspaces
24+ ? . Where ( w =>
25+ ! string . IsNullOrWhiteSpace ( w . Name ) &&
26+ physicians . Any ( p => w . Name . StartsWith ( p + " Workspace" , StringComparison . OrdinalIgnoreCase ) ) )
2527 . Select ( a => new PhysicianModel
2628 {
2729 Name = a . Name ,
2830 WorkspaceId = a . WorkspaceId
2931 } ) . ToList ( ) ;
3032
31- if ( physician ? . Count = = physicians . Count )
33+ if ( createdPhysician ? . Count > = physicians . Count )
3234 {
33- return physician ;
35+ return createdPhysician . DistinctBy ( a => a . Name ) . ToList ( ) ;
3436 }
3537 }
3638
You can’t perform that action at this time.
0 commit comments