Skip to content

Implement type conversion for non-nullable types#3

Closed
TitovPavel wants to merge 3 commits into
ai-iskuzhin:mainfrom
TitovPavel:patch-1
Closed

Implement type conversion for non-nullable types#3
TitovPavel wants to merge 3 commits into
ai-iskuzhin:mainfrom
TitovPavel:patch-1

Conversation

@TitovPavel

Copy link
Copy Markdown
Contributor

Add type conversion for non-nullable types using TypeDescriptor.

Add type conversion for non-nullable types using TypeDescriptor.
@ai-iskuzhin

Copy link
Copy Markdown
Owner

Hey, thanks for PR, please review your code changes again and run tests. I will add CI/CD for tests stage so we won't miss it next time.

*  Executing task: dotnet: build /Users/aigiz/work/rsql-parser-dotnet/tests/RsqlParserNet.Linq.Tests/RsqlParserNet.Linq.Tests.csproj 

dotnet build /Users/aigiz/work/rsql-parser-dotnet/tests/RsqlParserNet.Linq.Tests/RsqlParserNet.Linq.Tests.csproj /property:GenerateFullPaths=true /p:Configuration=Debug /p:Platform=AnyCPU /consoleloggerparameters:NoSummary 
C# extension build result service is available.
  Determining projects to restore...
  All projects are up-to-date for restore.
  RsqlParserNet -> /Users/aigiz/work/rsql-parser-dotnet/src/RsqlParserNet/bin/Debug/net10.0/RsqlParserNet.dll
/Users/aigiz/work/rsql-parser-dotnet/src/RsqlParserNet.Linq/RsqlPredicateBuilder.cs(354,29): error CS0103: The name 'TypeDescriptor' does not exist in the current context [/Users/aigiz/work/rsql-parser-dotnet/src/RsqlParserNet.Linq/RsqlParserNet.Linq.csproj]

Build FAILED.

/Users/aigiz/work/rsql-parser-dotnet/src/RsqlParserNet.Linq/RsqlPredicateBuilder.cs(354,29): error CS0103: The name 'TypeDescriptor' does not exist in the current context [/Users/aigiz/work/rsql-parser-dotnet/src/RsqlParserNet.Linq/RsqlParserNet.Linq.csproj]
    0 Warning(s)
    1 Error(s)

Time Elapsed 00:00:01.20

 *  The terminal process terminated with exit code: 1. 
 *  Terminal will be reused by tasks, press any key to close it. 

ai-iskuzhin added a commit that referenced this pull request Jun 16, 2026
Convert RSQL filter values to custom mapped types that expose a
TypeConverter (strongly-typed IDs, value objects). The converter is
resolved through TypeDescriptor as a fallback right before
Convert.ChangeType, so existing parsing semantics and value
normalization (including DateTimeOffset UTC normalization) are
preserved.

Reworks the approach proposed in #3 to run as a fallback and route the
converted value through NormalizeValue. Adds a test covering a custom
TypeConverter-backed type and bumps RsqlParserNet.Linq to 1.0.3.

Co-authored-by: TitovPavel <52369020+TitovPavel@users.noreply.github.com>
@ai-iskuzhin

Copy link
Copy Markdown
Owner

Thanks for fix of build, some tests are failing with your code changes:

RsqlQueryableExtensionsTests.BuildPredicate_AppliesCustomValueNormalizerAfterConversion
  Expected: ["Bike"]   Actual: ["Board"]

RsqlQueryableExtensionsTests.BuildPredicate_NormalizesDateTimeOffsetConstantsToUtcByDefault
  Expected: 00:00:00   Actual: 05:00:00

but i got your idea of proposed changes, and implemented it with 8070f4f.

I will release 1.0.3 for LINQ Nuget package right away

@TitovPavel

Copy link
Copy Markdown
Contributor Author

@ai-iskuzhin Thank you, that's fantastic!

@TitovPavel

TitovPavel commented Jun 16, 2026

Copy link
Copy Markdown
Contributor Author

@ai-iskuzhin
image

@ai-iskuzhin

Copy link
Copy Markdown
Owner

@ai-iskuzhin image

My mistake, i will fix it by releasing 1.0.3 fully

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.

2 participants