refactor: Enhancements to Query Management and Consistency in SQL Queries #297
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Title: Enhancements to Query Management and Consistency in SQL Queries
Hello,
I've made several improvements to the codebase, focusing on enhancing readability and consistency across all SQL queries. Below is a detailed breakdown of the changes:
Adoption of C# Raw String Literals: Utilizing the new Raw string literal feature introduced in C# 11, I've refactored the queries for improved readability and reduced complexity. This feature allows for multi-line strings without the need for escape characters, making the SQL queries more readable and maintainable.
Dynamic Alias Names in SQL Queries: Wherever alias names in SQL queries were hard-coded, I have updated them to dynamically derive from the DTO property names. This ensures better alignment between the database layer and the data transfer objects, enhancing code consistency and reducing the risk of errors during refactoring or property name changes.
Partial Refactor of Update Queries: I've rewritten a portion of the update queries to i clarity. The remaining update queries will be addressed in a subsequent PR.
I have moved all queries into their own constant strings. This change streamlines the code structure.
The primary goal of these changes is to increase the readability and consistency of the SQL queries throughout the entire codebase. This should aid future development and maintenance efforts.
Looking forward to your feedback and suggestions.