File tree Expand file tree Collapse file tree 1 file changed +5
-11
lines changed
dotnet/src/Microsoft.Agents.AI.Purview Expand file tree Collapse file tree 1 file changed +5
-11
lines changed Original file line number Diff line number Diff line change @@ -242,22 +242,16 @@ private async Task<ProcessContentResponse> ProcessContentWithProtectionScopesAsy
242242 /// </summary>
243243 /// <param name="pcResponse">The process content response which may contain DLP actions.</param>
244244 /// <param name="actionInfos">DLP actions returned from protection scopes.</param>
245- /// <returns>The process content response with the protection scopes DLP actions added. Actions are deduplicated. </returns>
245+ /// <returns>The process content response with the protection scopes DLP actions added.</returns>
246246 private static ProcessContentResponse CombinePolicyActions ( ProcessContentResponse pcResponse , List < DlpActionInfo > ? actionInfos )
247247 {
248- if ( actionInfos == null || actionInfos . Count == 0 )
248+ if ( actionInfos ? . Count > 0 )
249249 {
250- return pcResponse ;
251- }
252-
253- if ( pcResponse . PolicyActions == null )
254- {
255- pcResponse . PolicyActions = actionInfos ;
256- return pcResponse ;
250+ pcResponse . PolicyActions = pcResponse . PolicyActions is null ?
251+ actionInfos :
252+ [ .. pcResponse . PolicyActions , .. actionInfos ] ;
257253 }
258254
259- List < DlpActionInfo > pcActionInfos = [ .. pcResponse . PolicyActions , .. actionInfos ] ;
260- pcResponse . PolicyActions = pcActionInfos ;
261255 return pcResponse ;
262256 }
263257
You can’t perform that action at this time.
0 commit comments