Merge pull request #5 from PoweredSoft/feature/netcore3
Feature/netcore3
This commit is contained in:
commit
071a58dd13
@ -1,7 +1,7 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 15
|
||||
VisualStudioVersion = 15.0.28010.0
|
||||
# Visual Studio Version 16
|
||||
VisualStudioVersion = 16.0.29326.143
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PoweredSoft.DynamicQuery.Core", "PoweredSoft.DynamicQuery.Core\PoweredSoft.DynamicQuery.Core.csproj", "{E614658D-6852-4405-B5BE-3695C3E96B13}"
|
||||
EndProject
|
||||
@ -19,6 +19,12 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PoweredSoft.DynamicQuery.Te
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PoweredSoft.DynamicQuery.AspNetCore", "PoweredSoft.DynamicQuery.AspNetCore\PoweredSoft.DynamicQuery.AspNetCore.csproj", "{DF58BD18-AB47-4018-B1EA-D1118D93B408}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PoweredSoft.DynamicQuery.NewtonsoftJson", "PoweredSoft.DynamicQuery.NewtonsoftJson\PoweredSoft.DynamicQuery.NewtonsoftJson.csproj", "{201D7ACB-E11A-47EE-80F6-3F6BFB947DCA}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PoweredSoft.DynamicQuery.System.Text.Json", "PoweredSoft.DynamicQuery.System.Text.Json\PoweredSoft.DynamicQuery.System.Text.Json.csproj", "{552D67DD-AAB4-4D99-A067-08A593221C84}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PoweredSoft.DynamicQuery.AspNetCore.NewtonsoftJson", "PoweredSoft.DynamicQuery.AspNetCore.NewtonsoftJson\PoweredSoft.DynamicQuery.AspNetCore.NewtonsoftJson.csproj", "{7BBEEE93-A3DB-443B-8254-E148AC9663EA}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
@ -45,6 +51,18 @@ Global
|
||||
{DF58BD18-AB47-4018-B1EA-D1118D93B408}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{DF58BD18-AB47-4018-B1EA-D1118D93B408}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{DF58BD18-AB47-4018-B1EA-D1118D93B408}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{201D7ACB-E11A-47EE-80F6-3F6BFB947DCA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{201D7ACB-E11A-47EE-80F6-3F6BFB947DCA}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{201D7ACB-E11A-47EE-80F6-3F6BFB947DCA}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{201D7ACB-E11A-47EE-80F6-3F6BFB947DCA}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{552D67DD-AAB4-4D99-A067-08A593221C84}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{552D67DD-AAB4-4D99-A067-08A593221C84}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{552D67DD-AAB4-4D99-A067-08A593221C84}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{552D67DD-AAB4-4D99-A067-08A593221C84}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{7BBEEE93-A3DB-443B-8254-E148AC9663EA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{7BBEEE93-A3DB-443B-8254-E148AC9663EA}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{7BBEEE93-A3DB-443B-8254-E148AC9663EA}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{7BBEEE93-A3DB-443B-8254-E148AC9663EA}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
@ -0,0 +1,19 @@
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using PoweredSoft.DynamicQuery.NewtonsoftJson;
|
||||
|
||||
namespace PoweredSoft.DynamicQuery.AspNetCore.NewtonsoftJson
|
||||
{
|
||||
public static class MvcBuilderExtensions
|
||||
{
|
||||
public static IMvcBuilder AddPoweredSoftJsonNetDynamicQuery(this IMvcBuilder mvcBuilder, bool enableStringEnumConverter = true)
|
||||
{
|
||||
mvcBuilder.AddPoweredSoftDynamicQuery();
|
||||
var serviceProvider = mvcBuilder.Services.BuildServiceProvider();
|
||||
mvcBuilder.AddNewtonsoftJson(o =>
|
||||
{
|
||||
o.SerializerSettings.AddPoweredSoftDynamicQueryNewtonsoftJson(serviceProvider, enableStringEnumConverter: enableStringEnumConverter);
|
||||
});
|
||||
return mvcBuilder;
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp3.0</TargetFramework>
|
||||
<Copyright>Powered Softwares Inc.</Copyright>
|
||||
<PackageLicenseUrl>MIT</PackageLicenseUrl>
|
||||
<PackageProjectUrl>https://github.com/PoweredSoft/DynamicQuery</PackageProjectUrl>
|
||||
<RepositoryUrl>https://github.com/PoweredSoft/DynamicQuery</RepositoryUrl>
|
||||
<RepositoryType>github</RepositoryType>
|
||||
<PackageTags>powered,soft,dynamic,criteria,query,builder,asp,net,core</PackageTags>
|
||||
<Version>2.1.0$(VersionSuffix)</Version>
|
||||
<PackageIconUrl>https://secure.gravatar.com/avatar/4e32f73820c16718909a06c2927f1f8b?s=512&amp;r=g&amp;d=retro</PackageIconUrl>
|
||||
<Description>This projects makes it easier to use dynamic query in a asp.net core mvc project.</Description>
|
||||
<PackageId>PoweredSoft.DynamicQuery.AspNetCore.NewtonsoftJson</PackageId>
|
||||
<PackageRequireLicenseAcceptance>False</PackageRequireLicenseAcceptance>
|
||||
<Company>Powered Soft</Company>
|
||||
<Authors>David Lebee</Authors>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<FrameworkReference Include="Microsoft.AspNetCore.App" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="3.0.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\PoweredSoft.DynamicQuery.AspNetCore\PoweredSoft.DynamicQuery.AspNetCore.csproj" />
|
||||
<ProjectReference Include="..\PoweredSoft.DynamicQuery.NewtonsoftJson\PoweredSoft.DynamicQuery.NewtonsoftJson.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
@ -1,7 +1,5 @@
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using PoweredSoft.Data;
|
||||
using PoweredSoft.DynamicQuery.AspNetCore.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
@ -14,12 +12,6 @@ namespace PoweredSoft.DynamicQuery.AspNetCore
|
||||
{
|
||||
builder.Services.AddPoweredSoftDataServices();
|
||||
builder.Services.AddPoweredSoftDynamicQuery();
|
||||
var serviceProvider = builder.Services.BuildServiceProvider();
|
||||
builder.AddJsonOptions(o =>
|
||||
{
|
||||
o.SerializerSettings.Converters.Add(new StringEnumConverter());
|
||||
o.SerializerSettings.Converters.Add(new DynamicQueryJsonConverter(serviceProvider));
|
||||
});
|
||||
return builder;
|
||||
}
|
||||
}
|
||||
|
@ -1,14 +1,14 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp2.1</TargetFramework>
|
||||
<TargetFramework>netcoreapp3.0</TargetFramework>
|
||||
<Copyright>Powered Softwares Inc.</Copyright>
|
||||
<PackageLicenseUrl>MIT</PackageLicenseUrl>
|
||||
<PackageProjectUrl>https://github.com/PoweredSoft/DynamicQuery</PackageProjectUrl>
|
||||
<RepositoryUrl>https://github.com/PoweredSoft/DynamicQuery</RepositoryUrl>
|
||||
<RepositoryType>github</RepositoryType>
|
||||
<PackageTags>powered,soft,dynamic,criteria,query,builder,asp,net,core</PackageTags>
|
||||
<Version>2.0.0$(VersionSuffix)</Version>
|
||||
<Version>2.1.0$(VersionSuffix)</Version>
|
||||
<PackageIconUrl>https://secure.gravatar.com/avatar/4e32f73820c16718909a06c2927f1f8b?s=512&amp;r=g&amp;d=retro</PackageIconUrl>
|
||||
<Product>PoweredSoft.DynamicQuery.AspNetCore</Product>
|
||||
<Description>This projects makes it easier to use dynamic query in a asp.net core mvc project.</Description>
|
||||
@ -19,8 +19,7 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.Formatters.Json" Version="2.2.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="2.2.0" />
|
||||
<FrameworkReference Include="Microsoft.AspNetCore.App" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
@ -6,6 +6,7 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="3.0.0" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="12.0.2" />
|
||||
</ItemGroup>
|
||||
|
||||
|
@ -4,5 +4,6 @@
|
||||
{
|
||||
string Path { get; set; }
|
||||
object Value { get; set; }
|
||||
bool? Not { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -8,7 +8,7 @@
|
||||
<RepositoryUrl>https://github.com/PoweredSoft/DynamicQuery.Core/</RepositoryUrl>
|
||||
<RepositoryType>github</RepositoryType>
|
||||
<PackageTags>powered,soft,dynamic,criteria,query,builder</PackageTags>
|
||||
<Version>2.0.0$(VersionSuffix)</Version>
|
||||
<Version>2.1.0$(VersionSuffix)</Version>
|
||||
<PackageIconUrl>https://secure.gravatar.com/avatar/4e32f73820c16718909a06c2927f1f8b?s=512&amp;r=g&amp;d=retro</PackageIconUrl>
|
||||
<Product>PoweredSoft.DynamicQuery.Core</Product>
|
||||
<Description>core abstractions</Description>
|
||||
@ -18,4 +18,8 @@
|
||||
<Authors>David Lebee</Authors>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="3.0.0" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
@ -6,7 +6,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace PoweredSoft.DynamicQuery.AspNetCore.Json
|
||||
namespace PoweredSoft.DynamicQuery.NewtonsoftJson
|
||||
{
|
||||
public class DynamicQueryJsonConverter : JsonConverter
|
||||
{
|
19
PoweredSoft.DynamicQuery.NewtonsoftJson/Extensions.cs
Normal file
19
PoweredSoft.DynamicQuery.NewtonsoftJson/Extensions.cs
Normal file
@ -0,0 +1,19 @@
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using System;
|
||||
|
||||
namespace PoweredSoft.DynamicQuery.NewtonsoftJson
|
||||
{
|
||||
public static class JsonNetSerializationSettingsExtensions
|
||||
{
|
||||
public static JsonSerializerSettings AddPoweredSoftDynamicQueryNewtonsoftJson(this JsonSerializerSettings settings, IServiceProvider serviceProvider, bool enableStringEnumConverter = true)
|
||||
{
|
||||
if (enableStringEnumConverter)
|
||||
settings.Converters.Add(new StringEnumConverter());
|
||||
|
||||
settings.Converters.Add(new DynamicQueryJsonConverter(serviceProvider));
|
||||
return settings;
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
<Copyright>Powered Softwares Inc.</Copyright>
|
||||
<PackageLicenseUrl>MIT</PackageLicenseUrl>
|
||||
<PackageProjectUrl>https://github.com/PoweredSoft/DynamicQuery</PackageProjectUrl>
|
||||
<RepositoryUrl>https://github.com/PoweredSoft/DynamicQuery.Core/</RepositoryUrl>
|
||||
<RepositoryType>github</RepositoryType>
|
||||
<PackageTags>powered,soft,dynamic,criteria,query,builder</PackageTags>
|
||||
<Version>2.1.0$(VersionSuffix)</Version>
|
||||
<PackageIconUrl>https://secure.gravatar.com/avatar/4e32f73820c16718909a06c2927f1f8b?s=512&amp;r=g&amp;d=retro</PackageIconUrl>
|
||||
<PackageId>PoweredSoft.DynamicQuery.Newtonsoft.Json</PackageId>
|
||||
<PackageRequireLicenseAcceptance>False</PackageRequireLicenseAcceptance>
|
||||
<Company>Poweredsoft</Company>
|
||||
<Authors>David Lebee</Authors>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Newtonsoft.Json" Version="12.0.2" />
|
||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="3.0.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\PoweredSoft.DynamicQuery.Core\PoweredSoft.DynamicQuery.Core.csproj" />
|
||||
</ItemGroup>
|
||||
</Project>
|
@ -0,0 +1,23 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp3.0</TargetFramework>
|
||||
<Copyright>Powered Softwares Inc.</Copyright>
|
||||
<PackageLicenseUrl>MIT</PackageLicenseUrl>
|
||||
<PackageProjectUrl>https://github.com/PoweredSoft/DynamicQuery</PackageProjectUrl>
|
||||
<RepositoryUrl>https://github.com/PoweredSoft/DynamicQuery.Core/</RepositoryUrl>
|
||||
<RepositoryType>github</RepositoryType>
|
||||
<PackageTags>powered,soft,dynamic,criteria,query,builder</PackageTags>
|
||||
<Version>2.1.0$(VersionSuffix)</Version>
|
||||
<PackageIconUrl>https://secure.gravatar.com/avatar/4e32f73820c16718909a06c2927f1f8b?s=512&amp;r=g&amp;d=retro</PackageIconUrl>
|
||||
<PackageId>PoweredSoft.DynamicQuery.System.Text.Json</PackageId>
|
||||
<PackageRequireLicenseAcceptance>False</PackageRequireLicenseAcceptance>
|
||||
<Company>Poweredsoft</Company>
|
||||
<Authors>David Lebee</Authors>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\PoweredSoft.DynamicQuery.Core\PoweredSoft.DynamicQuery.Core.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
@ -118,6 +118,34 @@ namespace PoweredSoft.DynamicQuery.Test
|
||||
});
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SimpleFilterWithNot()
|
||||
{
|
||||
MockContextFactory.SeedAndTestContextFor("AsyncTests_SimpleFilter2", TestSeeders.SimpleSeedScenario, async ctx =>
|
||||
{
|
||||
var resultShouldMatch = ctx.Items.Where(t => !t.Name.EndsWith("Cables")).ToList();
|
||||
|
||||
var criteria = new QueryCriteria()
|
||||
{
|
||||
Filters = new List<IFilter>
|
||||
{
|
||||
new SimpleFilter
|
||||
{
|
||||
Path = "Name",
|
||||
Type = FilterType.EndsWith,
|
||||
Value = "Cables",
|
||||
Not = true
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var asyncService = new AsyncQueryableService(new[] { new AsyncQueryableHandlerService() });
|
||||
var queryHandler = new QueryHandlerAsync(asyncService);
|
||||
var result = await queryHandler.ExecuteAsync(ctx.Items, criteria);
|
||||
Assert.Equal(resultShouldMatch, result.Data);
|
||||
});
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void TestPaging()
|
||||
{
|
||||
|
@ -1,8 +1,8 @@
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using PoweredSoft.DynamicQuery.AspNetCore.Json;
|
||||
using PoweredSoft.DynamicQuery.Core;
|
||||
using PoweredSoft.DynamicQuery.NewtonsoftJson;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
@ -22,6 +22,7 @@ namespace PoweredSoft.DynamicQuery.Test
|
||||
var serviceProvider = serviceCollection.BuildServiceProvider();
|
||||
|
||||
var settings = new JsonSerializerSettings();
|
||||
|
||||
settings.Converters.Add(new StringEnumConverter());
|
||||
settings.Converters.Add(new DynamicQueryJsonConverter(serviceProvider));
|
||||
|
||||
|
@ -17,6 +17,7 @@ namespace PoweredSoft.DynamicQuery.Test
|
||||
public FilterType Type { get; set; } = FilterType.Equal;
|
||||
public string Path { get; set; } = "FirstName";
|
||||
public object Value { get; set; } = "Chuck";
|
||||
public bool? Not { get; set; }
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
@ -140,10 +140,11 @@ namespace PoweredSoft.DynamicQuery.Test
|
||||
Count++;
|
||||
}
|
||||
|
||||
public async Task AfterReadAsync(List<Tuple<Ticket, object>> pairs, CancellationToken cancellationToken = default(CancellationToken))
|
||||
public Task AfterReadAsync(List<Tuple<Ticket, object>> pairs, CancellationToken cancellationToken = default(CancellationToken))
|
||||
{
|
||||
Test2 = true;
|
||||
Count++;
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
public void AfterReadEntity(List<Ticket> entities)
|
||||
@ -152,10 +153,11 @@ namespace PoweredSoft.DynamicQuery.Test
|
||||
Count++;
|
||||
}
|
||||
|
||||
public async Task AfterReadEntityAsync(List<Ticket> entities, CancellationToken cancellationToken = default(CancellationToken))
|
||||
public Task AfterReadEntityAsync(List<Ticket> entities, CancellationToken cancellationToken = default(CancellationToken))
|
||||
{
|
||||
Test4 = true;
|
||||
Count++;
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
public object InterceptResultTo(Ticket entity)
|
||||
|
@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Diagnostics;
|
||||
using Microsoft.VisualStudio.TestPlatform.ObjectModel.Engine.ClientProtocol;
|
||||
using Xunit.Sdk;
|
||||
|
||||
@ -12,7 +13,12 @@ namespace PoweredSoft.DynamicQuery.Test.Mock
|
||||
{
|
||||
public static void TestContextFor(string testName, Action<MockContext> action)
|
||||
{
|
||||
var options = new DbContextOptionsBuilder<MockContext>().UseInMemoryDatabase(databaseName: testName).Options;
|
||||
var options = new DbContextOptionsBuilder<MockContext>()
|
||||
.ConfigureWarnings(warnings =>
|
||||
warnings.Ignore(RelationalEventId.QueryClientEvaluationWarning)
|
||||
)
|
||||
.UseInMemoryDatabase(databaseName: testName).Options;
|
||||
|
||||
using (var ctx = new MockContext(options))
|
||||
action(ctx);
|
||||
}
|
||||
|
@ -1,16 +1,18 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp2.1</TargetFramework>
|
||||
<TargetFramework>netcoreapp3.0</TargetFramework>
|
||||
|
||||
<IsPackable>false</IsPackable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Bogus" Version="28.0.2" />
|
||||
<PackageReference Include="Bogus" Version="28.3.2" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="2.2.6" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="2.2.6" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="2.2.6" />
|
||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="3.0.0" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.3.0" />
|
||||
<PackageReference Include="PoweredSoft.Data.EntityFrameworkCore" Version="1.1.3" />
|
||||
<PackageReference Include="xunit" Version="2.4.1" />
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1">
|
||||
@ -21,6 +23,7 @@
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\PoweredSoft.DynamicQuery.AspNetCore\PoweredSoft.DynamicQuery.AspNetCore.csproj" />
|
||||
<ProjectReference Include="..\PoweredSoft.DynamicQuery.NewtonsoftJson\PoweredSoft.DynamicQuery.NewtonsoftJson.csproj" />
|
||||
<ProjectReference Include="..\PoweredSoft.DynamicQuery\PoweredSoft.DynamicQuery.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
|
@ -14,6 +14,7 @@ namespace PoweredSoft.DynamicQuery
|
||||
public class SimpleFilter : ISimpleFilter
|
||||
{
|
||||
public bool? And { get; set; }
|
||||
public bool? Not { get; set; }
|
||||
public FilterType Type { get; set; }
|
||||
public string Path { get; set; }
|
||||
public object Value { get; set; }
|
||||
|
@ -8,7 +8,7 @@
|
||||
<RepositoryUrl>https://github.com/PoweredSoft/DynamicQuery</RepositoryUrl>
|
||||
<RepositoryType>github</RepositoryType>
|
||||
<PackageTags>powered,soft,dynamic,criteria,query,builder</PackageTags>
|
||||
<Version>2.0.0$(VersionSuffix)</Version>
|
||||
<Version>2.1.0$(VersionSuffix)</Version>
|
||||
<PackageIconUrl>https://secure.gravatar.com/avatar/4e32f73820c16718909a06c2927f1f8b?s=512&amp;r=g&amp;d=retro</PackageIconUrl>
|
||||
<Product>PoweredSoft.DynamicQuery</Product>
|
||||
<Description>dynamic query based on string path very usefull for network requests.</Description>
|
||||
@ -19,7 +19,7 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="2.2.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="3.0.0" />
|
||||
<PackageReference Include="PoweredSoft.Data" Version="1.1.3" />
|
||||
<PackageReference Include="PoweredSoft.DynamicLinq" Version="1.1.8" />
|
||||
</ItemGroup>
|
||||
|
@ -339,7 +339,7 @@ namespace PoweredSoft.DynamicQuery
|
||||
protected virtual void ApplySimpleFilter<TSource>(WhereBuilder whereBuilder, ISimpleFilter filter)
|
||||
{
|
||||
var resolvedConditionOperator = ResolveConditionOperatorFrom(filter.Type);
|
||||
whereBuilder.Compare(filter.Path, resolvedConditionOperator, filter.Value, and: filter.And == true);
|
||||
whereBuilder.Compare(filter.Path, resolvedConditionOperator, filter.Value, and: filter.And == true, negate: filter.Not == true);
|
||||
}
|
||||
|
||||
protected virtual IFilter InterceptFilter<TSource>(IFilter filter)
|
||||
|
@ -18,15 +18,18 @@ Full Version | NuGet
|
||||
PoweredSoft.DynamicQuery | <a href="https://www.nuget.org/packages/PoweredSoft.DynamicQuery/" target="_blank">[![NuGet](https://img.shields.io/nuget/v/PoweredSoft.DynamicQuery.svg?style=flat-square&label=nuget)](https://www.nuget.org/packages/PoweredSoft.DynamicQuery/)</a> | ```PM> Install-Package PoweredSoft.DynamicQuery```
|
||||
PoweredSoft.DynamicQuery.Core | <a href="https://www.nuget.org/packages/PoweredSoft.DynamicQuery.Core/" target="_blank">[![NuGet](https://img.shields.io/nuget/v/PoweredSoft.DynamicQuery.Core.svg?style=flat-square&label=nuget)](https://www.nuget.org/packages/PoweredSoft.DynamicQuery.Core/)</a> | ```PM> Install-Package PoweredSoft.DynamicQuery.Core```
|
||||
PoweredSoft.DynamicQuery.AspNetCore | <a href="https://www.nuget.org/packages/PoweredSoft.DynamicQuery.AspNetCore/" target="_blank">[![NuGet](https://img.shields.io/nuget/v/PoweredSoft.DynamicQuery.AspNetCore.svg?style=flat-square&label=nuget)](https://www.nuget.org/packages/PoweredSoft.DynamicQuery.AspNetCore/)</a> | ```PM> Install-Package PoweredSoft.DynamicQuery.AspNetCore```
|
||||
PoweredSoft.DynamicQuery.AspNetCore.NewtonsoftJson | <a href="https://www.nuget.org/packages/PoweredSoft.DynamicQuery.AspNetCore.NewtonsoftJson/" target="_blank">[![NuGet](https://img.shields.io/nuget/v/PoweredSoft.DynamicQuery.AspNetCore.NewtonsoftJson.svg?style=flat-square&label=nuget)](https://www.nuget.org/packages/PoweredSoft.DynamicQuery.AspNetCore.NewtonsoftJson/)</a> | ```PM> Install-Package PoweredSoft.DynamicQuery.AspNetCore.NewtonsoftJson```
|
||||
|
||||
## Using in ASP.NET Core
|
||||
|
||||
The package Asp.net core of dynamic query will help you start to use Dynamic Query faster in your web project.
|
||||
|
||||
### How to configure during startup
|
||||
> For NET CORE 2.x look at v2.0 branch.
|
||||
|
||||
### How to configure during startup (NET Core 3)
|
||||
|
||||
```csharp
|
||||
using PoweredSoft.DynamicQuery.AspNetCore;
|
||||
using PoweredSoft.DynamicQuery.AspNetCore.NewtonsoftJson;
|
||||
|
||||
public class Startup
|
||||
{
|
||||
@ -34,7 +37,7 @@ public class Startup
|
||||
{
|
||||
services
|
||||
.AddMvc()
|
||||
.AddPoweredSoftDynamicQuery();
|
||||
.AddPoweredSoftJsonNetDynamicQuery();
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user