-
Notifications
You must be signed in to change notification settings - Fork 23
Update .NET, Async with EF Core , Typed Result and Nullable Reference Types #28
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
Open
luizfbicalho
wants to merge
16
commits into
linmasaki:master
Choose a base branch
from
luizfbicalho:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Updated project files to target .NET 8.0, removing older framework references. - Replaced `JsonSerializer` with `JsonConvert` for deserialization in test files. - Changed assertions from `Assert` to `ClassicAssert` in tests. - Removed .NET Core 3.1 conditional compilation from `CustomJsonSerializerOptions.cs`. - Updated NUnit and Entity Framework Core package versions for compatibility.
Updated the DataSourceResult class to a generic type DataSourceResult<T>, enhancing type safety by using IEnumerable<T> for data and IEnumerable<GroupResult> for groups. Adjusted methods in QueryableExtensions to return DataSourceResult<T> and updated method signatures to support generic types. Reorganized using directives for clarity. These changes improve flexibility and type safety in Kendo DataSource operations.
- Target .NET 8.0 in KendoNET.DynamicLinq.EFCore.csproj, enabling nullable reference types and adding EF Core 9.0.5. - Introduce asynchronous methods in QueryableExtensions for improved data processing. - Update solution file to include KendoNET.DynamicLinq.EFCore and change Visual Studio version to 17. - Modify Aggregator properties to initialize with default values and update return types to be nullable. - Ensure DataSourceRequest and DataSourceResult properties are initialized to prevent null references. - Enhance Filter class with better null handling and error reporting. - Update Group, GroupResult, and GroupSelector classes for property initialization. - Refactor QueryableExtensions for consistency and improved error handling.
- Updated `QueryableExtensions.cs` to use async processing for `GroupByMany`, improving performance. - Changed `Items` property in `GroupResult` from dynamic to `IEnumerable<GroupResult>` in `EnumerableExtensions.cs` for better type safety. - Organized using directives in `GroupResult.cs` and ensured necessary namespaces are included.
Introduced a new `UpdateQuery` method to consolidate sorting and paging logic for queryable data. Removed inline grouping, sorting, and paging code from the main flow to enhance code organization and readability. The new method accepts parameters for queryable data, pagination, and sorting/grouping, returning the updated queryable while maintaining the overall result structure.
- Changed repository name from `linmasaki` to `luizfbicalho` in CHANGELOG.md for multiple versions. - Updated LICENSE file to reflect copyright ownership by `luiz bicalho`. - Modified README.md to indicate support for .NET 8, replacing .NET Core 1.x to 3.x. - Updated sample code reference link in README.md to the new repository URL. - Revised instructions for adding the repository URL to NuGet package metadata.
Updated the README.md to reflect support for .NET 8.0 by replacing the .NET Standard badge with a .NET 8.0 badge. This change highlights the compatibility of KendoNET.DynamicLinq with the latest .NET version.
- Target .NET 8.0 in `KendoNET.DynamicLinq.EFCore.csproj`. - Add new package references for analyzers and tools. - Change package ID to `KendoNET.luizfbicalho.DynamicLinq`. - Add exception documentation in `QueryableExtensions.cs`, `Aggregator.cs`, `DataSourceResult.cs`, `EnumerableExtensions.cs`, and `Filter.cs`. - Refactor exception handling for clarity and maintainability. - Change `JsonSerializerOptions` fields to readonly in test files. - Overall improvements to documentation and project structure.
- Updated `GetSumAvg` to use `nameof` for type safety. - Removed commented-out code in `Filter.cs` to simplify logic. - Changed `sort` handling in `QueryableExtensions.cs` for clarity. - Eliminated the default sorting method, indicating a shift in sorting strategy. - Overall, these changes enhance maintainability and code quality.
- Added warning suppression in `Aggregator.cs` for reflection usage. - Removed null check for selector in `EnumerableExtensions.cs`, which may lead to potential null reference exceptions. - Changed `Selector` in `GroupSelector.cs` to a non-nullable type with a default value to enhance safety. - Updated `using` directives in `QueryableExtensions.cs` to include `System.Globalization`. - Modified `DateTime.TryParse` to use culture-specific parsing with `DateTimeFormatInfo.CurrentInfo`. - Specified `DateTimeKind.Unspecified` for `DateTime` objects in `QueryableExtensions.cs` to clarify date interpretation.
Updated code to use lowercase `string` type for consistency. Modified `Sort` and `Page` methods in `QueryableExtensions.cs` to use extension method syntax. Simplified object initialization in the `Filter` class for improved readability while preserving existing functionality and documentation.
This commit refactors several classes to use extension methods for `IQueryable<T>`, enhancing readability and maintainability. Key changes include: - Updated `Filters`, `Aggregates`, and `UpdateQuery` in `QueryableExtensions.cs` to be extension methods for fluent syntax. - Modernized string splitting in `Aggregator.cs` with improved syntax. - Refactored aggregate handling in `EnumerableExtensions.cs` for consistency. - Enhanced null handling and exception throwing in `Filter.cs` using the null-coalescing operator. - Simplified array initializations in `MockData.cs` and `Program.cs`. - Updated tests in `KendoNET.DynamicLinq.Test` to align with new method signatures. These changes improve code clarity and align with modern C# practices.
Changed class name from `QueryableExtensionsAsync` to `QueryableAsyncExtensionsAsync` in `QueryableAsyncExtensions.cs` to better reflect its purpose as an asynchronous extension for querying data.
This commit updates the `Filter` parameter in the `ToDataSourceResultAsync` and `ToDataSourceResult` methods, as well as the `Filters` method, to be nullable (`Filter?`). Additionally, the `Filter` property in the `DataSourceRequest` class is also changed to nullable. These changes enhance the handling of optional filters, improving code robustness.
Updated XML documentation across multiple files, including `QueryableAsyncExtensions.cs`, `DataSourceRequest.cs`, and `GroupResult.cs`, to clarify class properties and methods. Improved culture-invariant behavior in `Aggregator.cs` and ensured nullable support in `Filter.cs`. Enhanced type retrieval in `DataSourceResult.cs` and introduced `GroupSelector.cs` with comprehensive documentation.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
I looked that this project looks abandoned
So I created a fork with some features and you can use/help
NET 8.0
Nullable Reference Types
Typed Result (based on @aaronasmith)
Changed ToDataSourceResultAsync to use EF core in a separate library and use CountAsync, ToListAsync, and so on
Tests with Newtonsoft and System.Text Json separated
I'm open to suggestions