Skip to content

Commit 9ea348b

Browse files
Ticket #30 : Fix extension method
1 parent aec2fe9 commit 9ea348b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Scim/SimpleIdServer.Scim/Extensions/SCIMRepresentationAttributeExtensions.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,17 @@ public static SCIMRepresentationAttribute GetAttribute(this ICollection<SCIMRepr
3030
return attr.Values.GetAttribute(lst);
3131
}
3232

33-
public static void GetAttributesByAttrSchemaId(this ICollection<SCIMRepresentationAttribute> attributes, string attrSchemaId, ICollection<SCIMRepresentationAttribute> result)
33+
public static void GetAttributesByAttrSchemaId(this ICollection<SCIMRepresentationAttribute> attributes, string attrSchemaId, List<SCIMRepresentationAttribute> result)
3434
{
3535
if (!attributes.Any())
3636
{
3737
return;
3838
}
3939

40-
var attr = attributes.Where(a => a.SchemaAttribute.Id == attrSchemaId).ToList();
41-
if (attr != null)
40+
var filteredAttributes = attributes.Where(a => a.SchemaAttribute.Id == attrSchemaId).ToList();
41+
if (filteredAttributes.Any())
4242
{
43-
attr.AddRange(attr);
43+
result.AddRange(filteredAttributes);
4444
}
4545

4646
var subAttributes = attributes.SelectMany(a => a.Values).ToList();

0 commit comments

Comments
 (0)