Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Format and apply rules #544

Merged
merged 14 commits into from
May 3, 2024
Merged

Add Format and apply rules #544

merged 14 commits into from
May 3, 2024

Conversation

MikeAlhayek
Copy link
Collaborator

@MikeAlhayek MikeAlhayek commented May 2, 2024

This PR apply some cleanup.

Also adds char support for StartsWith, EndsWith, and Contains

clone._clause = _clause;
clone._table = _table;

clone._select = _select == null ? null : new List<string>(_select);
Copy link
Owner

Choose a reason for hiding this comment

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

Looks suspicious, revert

@@ -1966,19 +1966,19 @@ await using (var session = _store.CreateSession())
await using (var session = _store.CreateSession())
{
Assert.Equal(2, await session.Query().For<Person>()
.With<PersonByName>(x => x.SomeName.StartsWith("S"))
Copy link
Owner

Choose a reason for hiding this comment

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

This is not supported, only StartsWith(string) is bound

Copy link
Owner

Choose a reason for hiding this comment

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

This could be added, but will require a custom test too, see static DefaultQuery()

@sebastienros
Copy link
Owner

Error Message:
   System.InvalidOperationException : Operation is not valid due to the current state of the object.
  Stack Trace:
     at System.Reflection.RuntimeMethodInfo.GetGenericMethodDefinition()

Probably due to the changes methods (string to char) that I mentioned. It can't find the method (the one accepting a char) and tried to get the generic form but fails

In DefaultQuery there is MethodMappings.TryGetValue(methodInfo.GetGenericMethodDefinition(), out action) which should check if it's a generic method before.

You still need to use the "string" based one

@sebastienros sebastienros enabled auto-merge (squash) May 3, 2024 00:18
@sebastienros sebastienros merged commit c748f4d into main May 3, 2024
2 checks passed
@sebastienros sebastienros deleted the ma/cleanup-formats branch May 3, 2024 00:22
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