Releases: Namoshek/DataTables.NetStandard
v3.0.2
What's Changed
- Bump Microsoft.EntityFrameworkCore.SqlServer from 6.0.4 to 6.0.5 by @dependabot in #60
- Bump Microsoft.EntityFrameworkCore.SqlServer from 6.0.5 to 6.0.6 by @dependabot in #61
- Bump Microsoft.EntityFrameworkCore.SqlServer from 6.0.6 to 6.0.7 by @dependabot in #62
- Bump Microsoft.EntityFrameworkCore.SqlServer from 6.0.7 to 6.0.8 by @dependabot in #63
- Bump Microsoft.EntityFrameworkCore.SqlServer from 6.0.8 to 6.0.9 by @dependabot in #64
- Bump AutoMapper from 11.0.1 to 12.0.0 by @dependabot in #65
- Bump AutoMapper.Extensions.Microsoft.DependencyInjection from 11.0.0 to 12.0.0 by @dependabot in #66
- Bump actions/setup-dotnet from 2 to 3 by @dependabot in #67
- Bump Microsoft.EntityFrameworkCore.SqlServer from 6.0.9 to 6.0.10 by @dependabot in #68
- Bump Microsoft.EntityFrameworkCore.SqlServer from 6.0.10 to 7.0.0 by @dependabot in #69
- Bump Newtonsoft.Json from 13.0.1 to 13.0.2 by @dependabot in #70
- Bump Microsoft.EntityFrameworkCore.SqlServer from 7.0.0 to 7.0.1 by @dependabot in #71
- Bump Microsoft.EntityFrameworkCore.SqlServer from 7.0.1 to 7.0.2 by @dependabot in #72
- Bump AutoMapper from 12.0.0 to 12.0.1 by @dependabot in #73
- Bump Microsoft.EntityFrameworkCore.SqlServer from 7.0.2 to 7.0.3 by @dependabot in #74
- Bump Newtonsoft.Json from 13.0.2 to 13.0.3 by @dependabot in #75
- Bump Microsoft.EntityFrameworkCore.SqlServer from 7.0.3 to 7.0.4 by @dependabot in #76
- Bump AutoMapper.Extensions.Microsoft.DependencyInjection from 12.0.0 to 12.0.1 by @dependabot in #77
- Bump Microsoft.EntityFrameworkCore.SqlServer from 7.0.4 to 7.0.5 by @dependabot in #78
- Bump Microsoft.EntityFrameworkCore.SqlServer from 7.0.5 to 7.0.7 by @dependabot in #79
- Bump Microsoft.EntityFrameworkCore.SqlServer from 7.0.7 to 7.0.8 by @dependabot in #80
- Bump Microsoft.EntityFrameworkCore.SqlServer from 7.0.8 to 7.0.9 by @dependabot in #81
- Bump Microsoft.EntityFrameworkCore.SqlServer from 7.0.9 to 7.0.10 by @dependabot in #82
- Bump actions/checkout from 3 to 4 by @dependabot in #83
- Bump Microsoft.EntityFrameworkCore.SqlServer from 7.0.10 to 7.0.11 by @dependabot in #84
- Bump Microsoft.EntityFrameworkCore.SqlServer from 7.0.11 to 7.0.12 by @dependabot in #85
- Bump Microsoft.EntityFrameworkCore.SqlServer from 7.0.12 to 7.0.13 by @dependabot in #86
- Bump Microsoft.EntityFrameworkCore.SqlServer from 7.0.13 to 7.0.14 by @dependabot in #88
- Bump actions/setup-dotnet from 3 to 4 by @dependabot in #89
- Bump github/codeql-action from 2 to 3 by @dependabot in #90
- Bump Microsoft.EntityFrameworkCore.SqlServer from 7.0.14 to 7.0.15 by @dependabot in #91
- Bump Microsoft.EntityFrameworkCore.SqlServer from 7.0.15 to 7.0.16 by @dependabot in #92
- Fix memory issue with expression constants by @nino-s in #93
Full Changelog: v3.0.1...v3.0.2
Bugfix: Created lambda expressions are using fresh expression parameters
As explained in #59, due to EFCore 6 query caching, it is important to not reuse expression parameter instances, e.g. from the ColumnSearchPredicate
of a DataTablesColumn
.
Remove override of IQueryable
With this release, the internal logic is simplified and the override IDataTablesQueryable
is being removed. This is a major release, although it should not affect you if you are not overriding internals.
.NET Standard 2.1 and EFCore 6 in Sample Project
With this release, the target framework of the DataTables.NetStandard
library has been changed to netstandard2.1
. Furthermore, the sample project does now use EFCore 6. This required a fix of the dynamically built expressions to avoid caching issues with EFCore (introduced in EFCore 5). If this leads to memory leaks, please report immediately!
Feature: allow dynamic creation of search predicates using provider expressions
With this release, it is now possible to create search predicates dynamically using a provider expression. The provider expression is invoked in-memory and not in-query, like the search predicates. This makes it possible to perform additional tasks on the search value before the actual search is happening. More details can be found in #21.
Stable version & dependency updates
With this release, the package can now be considered stable. This has been achieved by splitting the package from the other packages in the group, especially from DataTables.NetStandard.Enhanced
.
Also part of this release are the following changes:
Feature: support for custom order expressions for table columns
Bugfix: Displaying all Records (PageSize = -1) leads to Issue with EFCore on empty Lists
Thanks to @nino-s for fixing an issue in PR #4 where displaying all records using PageSize = -1
lead to an issue with EFCore for empty tables. This happened because we used the TotalCount
in Take(totalCount)
which lead to the combined usage of query.Skip(0).Take(0)
. Due to an unclear reason, EFCore cannot handle this combination of statements.
Per-Table Configuration in Favour of Global Configuration
With this release, the ability to configure DataTables globally has been removed. The reason for this drastic change is that it introduced issues with localization. It was impossible to configure the localized labels of DataTables on startup, which required it to be configured within each DataTable instance directly. As this wasn't thread-safe due to the configuration in a globally shared object, the change to a per-table configuration is the only reasonable solution.
Also changed have been the filters, which do now require a different way of initialization. The quickest way to get started is to have a look at the updated documentation.
Released were the following packages:
- DataTables.NetStandard v0.5.0
- DataTables.NetStandard.Enhanced v0.2.0
v0.4.1
Fixes
-
SearchPredicate
,ColumnSearchPredicate
andGlobalSearchPredicate
now work with nested expressions where the parameter replacement of the search value did not work properly before.Example which didn't work but works now:
SearchPredicate = (p, s) => p.EmailAddresses.Any(e => e.Address.Contains(s))
Before the fix, the parameters
has not been replaced in the inner expressione => e.Address.Contains(s)
properly. Now, instead of replacing the parameter, we simply wrap the expression in another expression and pass the search value as constant to the inner expression:var entityParam = expr.Parameters.Single(p => p.Type == typeof(TEntity)); var searchValueConstant = Expression.Constant(searchValue); expr = (Expression<Func<TEntity, bool>>)Expression.Lambda( Expression.Invoke(expr, entityParam, searchValueConstant), entityParam);