Skip to content
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

Support RuntimeContext and provide access to FilterExpressionCompiler from CustomFilters #589

Open
wants to merge 27 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
344745b
- Added RuntimeResolutionContext to allow passing in variables which …
statler Apr 6, 2023
4a61187
Update README.md
statler Apr 11, 2023
53a5f08
add projection methods
statler Apr 11, 2023
93f4afb
Add registration of devex maps
statler Apr 11, 2023
82e29fc
Merge remote-tracking branch 'origin/master' into dev/AddRuntimeResol…
statler Apr 11, 2023
0b5eca2
Update README.md
statler Apr 11, 2023
9caa4e3
Merge remote-tracking branch 'origin/master' into master
statler Apr 11, 2023
a51bde5
Update config for publish
statler Apr 11, 2023
77a67c8
Fix to pass parameters to Context.Mapper.ConfigurationProvider.Intern…
statler Apr 11, 2023
4f334d2
- Added context (Automapper objects) to customaccessor registration -…
statler Apr 12, 2023
76fc3c2
Version bump
statler Apr 12, 2023
66774a5
Update README.md
statler Apr 12, 2023
890adba
Update README.md
statler Apr 12, 2023
1980a7b
Refactored customfilters to remove redundant collections and fix bug …
statler Apr 12, 2023
c0a6a4b
Update README.md
statler Apr 13, 2023
2c433f7
Update README.md
statler Apr 13, 2023
6d7cdb0
Update README.md
statler Apr 13, 2023
191ee47
Merge remote-tracking branch 'origin/master' into dev/AddRuntimeResol…
statler Aug 11, 2023
eda620a
Fix for complex multi-projected queries from Automap
statler Mar 21, 2024
170fa8e
Change Dictionary to ConcurrentDictionary
statler Jun 10, 2024
5322b46
Merge remote-tracking branch 'githubDevex/master' into dev/AddRuntime…
statler Jun 10, 2024
9f43fc0
Tests changes
statler Jun 11, 2024
00220d7
Cleanup
statler Jun 17, 2024
4d6c4f1
Revert Mogodbb thingo
statler Jun 17, 2024
671681d
Update XPO to 24
statler Jul 3, 2024
841bb63
Update version for nupkg
statler Jul 12, 2024
d04cfd8
Catch nested dictionary to prevent concurrency problem
statler Jul 16, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
131 changes: 131 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,134 @@
**********************************************************************************************************************************************

This is a fork of Devexpress.AspNet.Data, a fantastic expression building library for querying an API. While designed to work with Devex controls, it also works as the base for free querying of Entity Framework Core and XPO data models.

Its main shortcoming in my use case was a lack of support for Automapper style projections. This fork provides those projections and also changes to support the injection of automapper parameters for use in customfilters.

Available as nuget at https://www.nuget.org/packages/DXAutomap.AspNet.Data/1.12.0

NuGet\Install-Package DXAutomap.AspNet.Data -Version 1.12.0

**********************************************************************************************************************************************

How to use:

The basic functionality is exactly the same as the devex library. The big difference is that the user can:
1. Specify a projection type to the LoadAsync method (ProjectTo in automapper). As long as this type is included in the registered mapping config(s), the projection will occur seamlessly with the results in the returned object. While it is possible to specify an (already projected) IQueryable to the LoadAsync in the base library, you lose the capacity to filter, sort or group on properties of the base object that aren't in the projection. **This library supports querying any property of the base object OR the mapped object**
2. Sort and group on original or mapped properties
3. Specify parameters to the LoadAsync method that will be accessible in the custom filters added through CustomFilterCompilers. This is important when you are passing parameters to an automapper ProjectTo that would change filters applied to the base object.
4. Specify that filters apply after a projection using the new DataSourceLoadOption property ProjectBeforeFilter
5. Utilise the devex expression builders for binary expressions by calling CompileNonCustomBinary
6. From Version 1.11, CustomAccessors also have access to the tuntime context (Automapper object)


**********************************************************************************************************************************************

Quick Start:
1. Register your mappings:

In startup register automapper as per usual

public void ConfigureServices(IServiceCollection services)
{
....
List<Assembly> lstAssembly = new List<Assembly>() { typeof(AutoMapperProfileService).GetTypeInfo().Assembly, typeof(AutoMapperProfileORM).GetTypeInfo().Assembly };
services.AddAutoMapper(lstAssembly);
....
}

In configure, call CustomAccessorCompilers.RegisterAutomapperProfiles. You can also add other accessors for filtering and sorting if you like.

public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
....

CustomFilters.RegisterFilters(); //
CustomAccessorCompilers.RegisterAutomapperProfiles(app.ApplicationServices.GetService<IMapper>());
//Additional mappers can be added like this:
//CustomAccessorLibrary.Add<AreaCode,string>("FirstLetter", t => t.AreaCodeName.FirstOrDefault().ToString().ToUpper());
//Or like this - a separate static class/method is recommended
//CustomAccessorCompilers.RegisterContext<Notification, DateTime?>("DateRead", (u) =>
//{
// dynamic dynObj = new DynamicWrapper(u);
// if (dynObj.UserId is int)
// {
// int UserId = dynObj.UserId;
// return src => src.NotificationTos.Where(x => x.UserId == UserId).OrderByDescending(x => x.NotificationTypeId).Select(x => x.DateRead).FirstOrDefault();
// }
// return src => null;
//});
....
}

2. If you have any custom filters requiring additional context (such as an object that is used in the Projection - refer below), you can register your filters using the RegisterBinaryExpressionCompilerWithContext. This works like devexpresses RegisterBinaryExpressionCompiler method, but includes the context. RegisterBinaryExpressionCompiler will still work for simpler maps. The example uses linqKit



public static partial class CustomFilters
{
public static void RegisterFilters()
{
CustomFilterCompilers.RegisterBinaryExpressionCompilerWithContext((info, rtContext) =>
{
if (info.DataItemExpression.Type == typeof(Notification))
{
if (info.AccessorText == "DateDismissed")
{
dynamic dynObj = new DynamicWrapper(rtContext.RuntimeResolutionContext);
if (int.TryParse(dynObj.UserId.ToString(), out int _ui))
{
var pBaseExp = info.DataItemExpression as ParameterExpression;
var pBaseProperty = Expression.PropertyOrField(pBaseExp, "NotificationTos");

var _p = Expression.Parameter(typeof(NotificationTo), "nTo");
var baseResult = rtContext.CompileNonCustomBinary(_p, GetParametersAsList(info));
var predicate = PredicateBuilder.New(Expression.Lambda<Func<NotificationTo, bool>>(baseResult, _p));
predicate.And((p) => p.UserId == _ui);

var result = Expression.Call(
typeof(Enumerable), "Any", new[] { _p.Type },
pBaseProperty, predicate);

var ex22 = Expression.Lambda(result, pBaseExp) as Expression<Func<Notification, bool>>;
return CompileWhereExpression(info, ex22).Body;
}
}
}
return null;
});
}
}

static IList GetParametersAsList(IBinaryExpressionInfo info)
{
var criteria = new List<object>() { info.AccessorText };
if (!string.IsNullOrWhiteSpace(info.Operation)) criteria.Add(info.Operation);
criteria.Add(info.Value);
return criteria;
}

3. Call your projection from LoadAsyncDto (or LoadDto)

return await DataSourceLoader.LoadAsync<T, TDto>(source, options, mapper, MapParameters);

mapper is your IMapper for automap
MapParameters are an object (usually null) that can be used for injecting context into a Projection. It is the second parameter of Automappers ProjectTo.



**********************************************************************************************************************************************

How it works:
- Beyond the mundane, there are three principle things here:
-- RegisterAutomapperProfiles iterates through every automapper map and creates a library of custom expressions that is resolved by a CompilerFunc registered using the base library's CustomAccessorCompilers.Register method. When expressions for sorting, filtering etc are constructed for a type, this library is queried to assemble any properties existing in the automap.
-- LoadAsync<T, TDto> fetches any map between T and TDto and constructs a select expression that is then injected into the devexpress expression resolution for select as if it was passed as an option. The output object is typed to the TDto.
-- The CompileNonCustomBinary is available in CustomFilters registered using RegisterBinaryExpressionCompilerWithContext. This means the devexpress Expression compiler for all operators such as "=", "<>" "<" ">" "contains" etc can be resolved without explicitly doing it yourself. This method is in the instance of FilterExpressionCompiler passed into the custom filter (second parameter)

**********************************************************************************************************************************************




# DevExtreme ASP.NET Data

[![CI](https://github.com/DevExpress/DevExtreme.AspNet.Data/actions/workflows/ci.yml/badge.svg?branch=master&event=push)](https://github.com/DevExpress/DevExtreme.AspNet.Data/actions/workflows/ci.yml)
Expand Down
6 changes: 6 additions & 0 deletions net/.cr/personal/FavoritesList/List.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Root Type="DevExpress.CodeRush.Foundation.CodePlaces.Options.FavoritesListContainer">
<Options Language="Neutral">
<Groups />
</Options>
</Root>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net461;net6.0</TargetFrameworks>
<TargetFrameworks>net7.0</TargetFrameworks>
<RootNamespace>DevExtreme.AspNet.Data.Tests</RootNamespace>
<IsTestProject>False</IsTestProject>
</PropertyGroup>
Expand Down
5 changes: 1 addition & 4 deletions net/DevExtreme.AspNet.Data.Tests.Common/SampleLoadOptions.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Collections.Generic;

namespace DevExtreme.AspNet.Data.Tests {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
Expand All @@ -15,7 +15,6 @@

<ItemGroup>
<ProjectReference Include="..\DevExtreme.AspNet.Data\DevExtreme.AspNet.Data.csproj" />
<ProjectReference Include="..\DevExtreme.AspNet.Data.Tests.Common\DevExtreme.AspNet.Data.Tests.Common.csproj" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="DevExpress.Xpo" Version="23.2.5" />
<PackageReference Include="DevExpress.Xpo" Version="24.1.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.1" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0</TargetFrameworks>
<TargetFrameworks>net7.0</TargetFrameworks>
<DefineConstants>NEWTONSOFT_TESTS</DefineConstants>
</PropertyGroup>

Expand Down
87 changes: 3 additions & 84 deletions net/DevExtreme.AspNet.Data.sln
Original file line number Diff line number Diff line change
Expand Up @@ -12,34 +12,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DevExtreme.AspNet.Data", "DevExtreme.AspNet.Data\DevExtreme.AspNet.Data.csproj", "{F91204F2-1F3A-433F-871D-5F31B769FA90}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DevExtreme.AspNet.Data.Tests", "DevExtreme.AspNet.Data.Tests\DevExtreme.AspNet.Data.Tests.csproj", "{BFF5CDCB-B8E0-4D4C-BCEB-18651691E1E1}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sample", "Sample\Sample.csproj", "{760B3927-BB40-4D5B-B64C-880E75E4A4A5}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DevExtreme.AspNet.Data.Tests.NET4", "DevExtreme.AspNet.Data.Tests.NET4\DevExtreme.AspNet.Data.Tests.NET4.csproj", "{D083C7D4-E8EC-409F-8B45-512FABB21A54}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DevExtreme.AspNet.Data.Tests.EF6", "DevExtreme.AspNet.Data.Tests.EF6\DevExtreme.AspNet.Data.Tests.EF6.csproj", "{C401BB6E-D21B-45D5-AB98-6B308DB4E4FB}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DevExtreme.AspNet.Data.Tests.Common", "DevExtreme.AspNet.Data.Tests.Common\DevExtreme.AspNet.Data.Tests.Common.csproj", "{F5878AD6-459F-4FCE-9BFB-54EE94D2083F}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DevExtreme.AspNet.Data.Tests.Xpo", "DevExtreme.AspNet.Data.Tests.Xpo\DevExtreme.AspNet.Data.Tests.Xpo.csproj", "{074B5988-B409-4BEE-BF12-79762B459857}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DevExtreme.AspNet.Data.Tests.NH", "DevExtreme.AspNet.Data.Tests.NH\DevExtreme.AspNet.Data.Tests.NH.csproj", "{B9B11471-3317-4A42-B3AE-1879B76E3941}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DevExtreme.AspNet.Data.Tests.L2S", "DevExtreme.AspNet.Data.Tests.L2S\DevExtreme.AspNet.Data.Tests.L2S.csproj", "{190E01CD-78FC-4578-ACBF-7D6C4DC57C18}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DevExtreme.AspNet.Data.Tests.EFCore3", "DevExtreme.AspNet.Data.Tests.EFCore3\DevExtreme.AspNet.Data.Tests.EFCore3.csproj", "{3DAF3316-6B1B-4961-831A-790647662554}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DevExtreme.AspNet.Data.Tests.EFCore5", "DevExtreme.AspNet.Data.Tests.EFCore5\DevExtreme.AspNet.Data.Tests.EFCore5.csproj", "{B8063440-8E4C-4D74-AF92-AE1737FAFD6F}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DevExtreme.AspNet.Data.Tests.EFCore6", "DevExtreme.AspNet.Data.Tests.EFCore6\DevExtreme.AspNet.Data.Tests.EFCore6.csproj", "{82748269-8B2F-4D65-8367-3D75146335F2}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DevExtreme.AspNet.Data.Tests.EFCore7", "DevExtreme.AspNet.Data.Tests.EFCore7\DevExtreme.AspNet.Data.Tests.EFCore7.csproj", "{EE44C4FD-0448-4F09-9612-6040E1DD2A8F}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DevExtreme.AspNet.Data.Tests.EFCore8", "DevExtreme.AspNet.Data.Tests.EFCore8\DevExtreme.AspNet.Data.Tests.EFCore8.csproj", "{CD8E0248-F0E8-4CE4-94C0-F8905E37D97F}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DevExtreme.AspNet.Data.Tests.EFCore9", "DevExtreme.AspNet.Data.Tests.EFCore9\DevExtreme.AspNet.Data.Tests.EFCore9.csproj", "{613530E9-013E-4FBD-BC3C-17F28B0C78EA}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -50,64 +22,11 @@ Global
{F91204F2-1F3A-433F-871D-5F31B769FA90}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F91204F2-1F3A-433F-871D-5F31B769FA90}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F91204F2-1F3A-433F-871D-5F31B769FA90}.Release|Any CPU.Build.0 = Release|Any CPU
{BFF5CDCB-B8E0-4D4C-BCEB-18651691E1E1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BFF5CDCB-B8E0-4D4C-BCEB-18651691E1E1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BFF5CDCB-B8E0-4D4C-BCEB-18651691E1E1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BFF5CDCB-B8E0-4D4C-BCEB-18651691E1E1}.Release|Any CPU.Build.0 = Release|Any CPU
{760B3927-BB40-4D5B-B64C-880E75E4A4A5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{760B3927-BB40-4D5B-B64C-880E75E4A4A5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{760B3927-BB40-4D5B-B64C-880E75E4A4A5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{760B3927-BB40-4D5B-B64C-880E75E4A4A5}.Release|Any CPU.Build.0 = Release|Any CPU
{D083C7D4-E8EC-409F-8B45-512FABB21A54}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D083C7D4-E8EC-409F-8B45-512FABB21A54}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D083C7D4-E8EC-409F-8B45-512FABB21A54}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D083C7D4-E8EC-409F-8B45-512FABB21A54}.Release|Any CPU.Build.0 = Release|Any CPU
{C401BB6E-D21B-45D5-AB98-6B308DB4E4FB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C401BB6E-D21B-45D5-AB98-6B308DB4E4FB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C401BB6E-D21B-45D5-AB98-6B308DB4E4FB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C401BB6E-D21B-45D5-AB98-6B308DB4E4FB}.Release|Any CPU.Build.0 = Release|Any CPU
{F5878AD6-459F-4FCE-9BFB-54EE94D2083F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F5878AD6-459F-4FCE-9BFB-54EE94D2083F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F5878AD6-459F-4FCE-9BFB-54EE94D2083F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F5878AD6-459F-4FCE-9BFB-54EE94D2083F}.Release|Any CPU.Build.0 = Release|Any CPU
{074B5988-B409-4BEE-BF12-79762B459857}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{074B5988-B409-4BEE-BF12-79762B459857}.Debug|Any CPU.Build.0 = Debug|Any CPU
{074B5988-B409-4BEE-BF12-79762B459857}.Release|Any CPU.ActiveCfg = Release|Any CPU
{074B5988-B409-4BEE-BF12-79762B459857}.Release|Any CPU.Build.0 = Release|Any CPU
{B9B11471-3317-4A42-B3AE-1879B76E3941}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B9B11471-3317-4A42-B3AE-1879B76E3941}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B9B11471-3317-4A42-B3AE-1879B76E3941}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B9B11471-3317-4A42-B3AE-1879B76E3941}.Release|Any CPU.Build.0 = Release|Any CPU
{190E01CD-78FC-4578-ACBF-7D6C4DC57C18}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{190E01CD-78FC-4578-ACBF-7D6C4DC57C18}.Debug|Any CPU.Build.0 = Debug|Any CPU
{190E01CD-78FC-4578-ACBF-7D6C4DC57C18}.Release|Any CPU.ActiveCfg = Release|Any CPU
{190E01CD-78FC-4578-ACBF-7D6C4DC57C18}.Release|Any CPU.Build.0 = Release|Any CPU
{3DAF3316-6B1B-4961-831A-790647662554}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3DAF3316-6B1B-4961-831A-790647662554}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3DAF3316-6B1B-4961-831A-790647662554}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3DAF3316-6B1B-4961-831A-790647662554}.Release|Any CPU.Build.0 = Release|Any CPU
{B8063440-8E4C-4D74-AF92-AE1737FAFD6F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B8063440-8E4C-4D74-AF92-AE1737FAFD6F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B8063440-8E4C-4D74-AF92-AE1737FAFD6F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B8063440-8E4C-4D74-AF92-AE1737FAFD6F}.Release|Any CPU.Build.0 = Release|Any CPU
{82748269-8B2F-4D65-8367-3D75146335F2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{82748269-8B2F-4D65-8367-3D75146335F2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{82748269-8B2F-4D65-8367-3D75146335F2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{82748269-8B2F-4D65-8367-3D75146335F2}.Release|Any CPU.Build.0 = Release|Any CPU
{EE44C4FD-0448-4F09-9612-6040E1DD2A8F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EE44C4FD-0448-4F09-9612-6040E1DD2A8F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EE44C4FD-0448-4F09-9612-6040E1DD2A8F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EE44C4FD-0448-4F09-9612-6040E1DD2A8F}.Release|Any CPU.Build.0 = Release|Any CPU
{CD8E0248-F0E8-4CE4-94C0-F8905E37D97F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CD8E0248-F0E8-4CE4-94C0-F8905E37D97F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CD8E0248-F0E8-4CE4-94C0-F8905E37D97F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CD8E0248-F0E8-4CE4-94C0-F8905E37D97F}.Release|Any CPU.Build.0 = Release|Any CPU
{613530E9-013E-4FBD-BC3C-17F28B0C78EA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{613530E9-013E-4FBD-BC3C-17F28B0C78EA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{613530E9-013E-4FBD-BC3C-17F28B0C78EA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{613530E9-013E-4FBD-BC3C-17F28B0C78EA}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {FDC8FE66-8841-4614-978F-0581BA981284}
EndGlobalSection
EndGlobal
4 changes: 2 additions & 2 deletions net/DevExtreme.AspNet.Data/Aggregation/AggregateCalculator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ class AggregateCalculator<T> {
Stack<Aggregator<T>[]> _groupAggregatorsStack;


public AggregateCalculator(IEnumerable data, IAccessor<T> accessor, IReadOnlyList<SummaryInfo> totalSummary, IReadOnlyList<SummaryInfo> groupSummary, SumFix sumFix = null) {
public AggregateCalculator(IEnumerable data, IAccessor<T> accessor, IReadOnlyList<SummaryInfo> totalSummary, IReadOnlyList<SummaryInfo> groupSummary, SumFix sumFix = null, object runtimeResolutionContext = null) {
_data = data;
_accessor = accessor;
_sumFix = sumFix ?? new SumFix(typeof(T), totalSummary, groupSummary);
_sumFix = sumFix ?? new SumFix(typeof(T), totalSummary, groupSummary, runtimeResolutionContext);

if(totalSummary != null && totalSummary.Count > 0)
_totalAggregators = totalSummary.Select(CreateAggregator).ToArray();
Expand Down
4 changes: 2 additions & 2 deletions net/DevExtreme.AspNet.Data/Aggregation/SumFix.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ class SumFix : ExpressionCompiler {
IReadOnlyList<SummaryInfo> _groupSummary;
IDictionary<string, object> _defaultValues;

public SumFix(Type itemType, IReadOnlyList<SummaryInfo> totalSummary, IReadOnlyList<SummaryInfo> groupSummary)
: base(itemType, false) {
public SumFix(Type itemType, IReadOnlyList<SummaryInfo> totalSummary, IReadOnlyList<SummaryInfo> groupSummary, object runtimeResolutionContext)
: base(itemType, false, runtimeResolutionContext) {
_totalSummary = totalSummary;
_groupSummary = groupSummary;
}
Expand Down
5 changes: 0 additions & 5 deletions net/DevExtreme.AspNet.Data/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,3 @@
[assembly: InternalsVisibleTo("DevExtreme.AspNet.Data.Tests.Xpo")]
#endif

[assembly: CLSCompliant(true)]

#if !DEBUG
[assembly: AssemblyKeyFile("release.snk")]
#endif
Loading