Webority.DataTables
0.0.1
See the version list below for details.
dotnet add package Webority.DataTables --version 0.0.1
NuGet\Install-Package Webority.DataTables -Version 0.0.1
<PackageReference Include="Webority.DataTables" Version="0.0.1" />
<PackageVersion Include="Webority.DataTables" Version="0.0.1" />
<PackageReference Include="Webority.DataTables" />
paket add Webority.DataTables --version 0.0.1
#r "nuget: Webority.DataTables, 0.0.1"
#:package Webority.DataTables@0.0.1
#addin nuget:?package=Webority.DataTables&version=0.0.1
#tool nuget:?package=Webority.DataTables&version=0.0.1
Webority.DataTables
High-performance ASP.NET Core DataTables library with .NET 9 optimizations for seamless integration with DataTables.js.
Features
- 🚀 Optimized for .NET 9 - Leverages latest performance features
- 📊 Server-side Processing - Efficient handling of large datasets
- 🔧 Model Binding - Automatic request parameter binding
- 🔍 Advanced Querying - Support for searching, sorting, and pagination
- 💾 Memory Efficient - Object pooling and reduced allocations
- ⚡ Expression Caching - Compiled expressions for better performance
- 🔄 Async Support - Full async/await pattern implementation
- 🎯 Type Safe - Strongly typed interfaces and implementations
Installation
dotnet add package Webority.DataTables
Quick Start
1. Configure Services
builder.Services.AddDataTables();
2. Controller Implementation
[HttpPost]
public async Task<IActionResult> GetData([DataTablesRequest] IDataTablesRequest request)
{
var query = _context.Products.AsQueryable();
// Apply DataTables operations and get response
var response = await query.ToDataTablesResponseAsync(request);
return DataTablesResult(response);
}
3. Client-side Setup
$('#myTable').DataTable({
processing: true,
serverSide: true,
ajax: {
url: '/api/products/data',
type: 'POST'
},
columns: [
{ data: 'name' },
{ data: 'price' },
{ data: 'category' },
{ data: 'stock' }
]
});
Advanced Usage
Custom Query Builder
var builder = query.ToDataTablesBuilder(request, new QueryOptimizationOptions
{
UseParallelExecution = true,
UseCompiledExpressions = true,
CacheTotalCount = true
});
var response = await builder.ExecuteAsync();
Projection for Better Performance
var response = await query.ToDataTablesResponseAsync(request,
product => new ProductDto
{
Id = product.Id,
Name = product.Name,
Price = product.Price
});
Custom Search Implementation
public static IQueryable<T> ApplyCustomSearch<T>(this IQueryable<T> query, IDataTablesRequest request)
{
if (!string.IsNullOrEmpty(request.Search?.Value))
{
// Apply custom search logic
query = query.Where(/* your predicate */);
}
return query;
}
Performance Optimizations
This library includes several performance optimizations:
- Expression Caching: Frequently used expressions are cached using
ConcurrentDictionary
- String Operations: Optimized with .NET 9's
SearchValues<T>
API - Memory Pooling: Reduces GC pressure through
ArrayPool<T>
and object pooling - Frozen Collections: Uses
FrozenDictionary
andFrozenSet
for read-only lookups - Async Patterns: Efficient async query execution with parallel operations
Configuration Options
services.AddDataTables(options =>
{
options.UseParallelExecution = true;
options.CacheTotalCount = true;
options.LargePageSizeThreshold = 1000;
options.MaxSearchableColumnsThreshold = 10;
});
Benchmarks
Performance improvements with .NET 9 optimizations:
- Query performance: 61.3% faster
- Expression caching: 3000 expressions in 5ms
- String operations: 20,000 operations in 4ms
- Object pooling: 1000 pooled objects in 1ms
Requirements
- .NET 9.0 or later
- ASP.NET Core 9.0 or later
- DataTables.js 1.10.0 or later
License
This project is licensed under the MIT License - see the LICENSE file for details.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Support
For issues and feature requests, please use the GitHub Issues page.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net9.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
v0.0.1 - Initial preview release with .NET 9 performance optimizations
- Expression caching for improved performance
- String operations optimization with SearchValues API
- Memory allocation reduction through object pooling
- Collection optimizations with FrozenDictionary/FrozenSet
- Async query patterns for better scalability
- Full backward compatibility maintained