Skip to content

Conversation

@chrisjainsley
Copy link

Added the ability to use the json.net's Json Property Attribute to map to the correct Azure search index fields.

#9

nkovacic and others added 6 commits September 27, 2018 08:51
This commit introduces significant improvements to how JSON property names are managed and serialized across the application. Key changes include the addition of the Newtonsoft.Json namespace to enhance JSON serialization capabilities. The `JsonProperty` attribute is now utilized in `Listing.cs` to customize the serialization name of the `Place` property to `"placeCoordinates"`, ensuring alignment with external API or data storage formats.

Furthermore, `AzureSearchMapping.cs` has been updated to leverage the `JsonPropertyAttribute` for more accurate and flexible property name mapping. This is complemented by the refactoring of `AzureSearchFieldsExpressionVisitor.cs`, which now uses the `NameHelper.GetMemberName` method for consistent field naming, abstracting away direct name manipulation.

The introduction of the `NameHelper` utility class centralizes the logic for resolving member names, supporting both explicit naming through `JsonProperty` attributes and default camel casing. This utility is also employed in `MemberProjectionExpressionVisitor.cs` to maintain naming consistency across the application.

Overall, these changes significantly enhance the flexibility and consistency of JSON property naming within the application, promoting better maintainability and code reuse.
Copy link
Owner

@nkovacic nkovacic left a comment

Choose a reason for hiding this comment

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

Seeing only formatting issues, otherwise great 👍.

@chrisjainsley chrisjainsley requested a review from nkovacic March 10, 2025 14:45
@chrisjainsley
Copy link
Author

@nkovacic, could we merge and release this? Let me know if there is anything I can do to help.

@chrisjainsley
Copy link
Author

Bumping this up again.

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