Skip to content

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
wants to merge 16 commits into
base: master
Choose a base branch
from

Conversation

luizfbicalho
Copy link

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

- 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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants