Skip to content

Conversation

@enisn
Copy link
Owner

@enisn enisn commented Oct 24, 2025

Enhanced ArraySearchFilterAttribute to handle nullable Guid properties by using extension methods for non-nullable types and value extraction. Added tests for filtering with Guid arrays without attribute and updated Preferences model to include OrganizationUnitId with ArraySearchFilter.

Closes #77

Enhanced ArraySearchFilterAttribute to handle nullable Guid properties by using extension methods for non-nullable types and value extraction. Added tests for filtering with Guid arrays without attribute and updated Preferences model to include OrganizationUnitId with ArraySearchFilter.
@enisn enisn requested a review from Copilot October 24, 2025 16:51
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR enhances the ArraySearchFilterAttribute to properly handle nullable Guid properties by introducing extension methods that convert nullable types to their non-nullable equivalents and extract values. The key change is using AsNonNullable() and GetValueExpressionIfNullable() extension methods to handle nullable types in the filter expressions.

Key Changes:

  • Modified ArraySearchFilterAttribute to use extension methods for handling nullable types
  • Added test case for filtering with Guid arrays without the attribute
  • Updated Preferences model to include nullable OrganizationUnitId property with ArraySearchFilter attribute

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
src/AutoFilterer/Attributes/ArraySearchFilterAttribute.cs Updated expression building logic to handle nullable types using extension methods
tests/AutoFilterer.Tests/Environment/Models/Preferences.cs Added nullable OrganizationUnitId property with ArraySearchFilter attribute for testing
tests/AutoFilterer.Tests/Environment/Dtos/PreferencesFilter_ArraySearchWithoutAttribute_Guid.cs New DTO for testing Guid array filtering without attribute
tests/AutoFilterer.Tests/Attributes/ArraySearchAttributeTests.cs Added test case for Guid array filtering without attribute

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@enisn enisn merged commit 93e2bb9 into develop Oct 24, 2025
3 checks passed
@enisn enisn deleted the nullable-guid-fix branch October 24, 2025 17:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ArraySearchFilter on GUID field

2 participants