Skip to content

Commit ba0bd3d

Browse files
committed
initial commit
0 parents  commit ba0bd3d

10 files changed

+943
-0
lines changed

.gitignore

+304
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,304 @@
1+
/.build/
2+
/global.json
3+
QueryBaseline.cs
4+
5+
## Ignore Visual Studio temporary files, build results, and
6+
## files generated by popular Visual Studio add-ons.
7+
##
8+
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
9+
10+
# User-specific files
11+
*.suo
12+
*.user
13+
*.userosscache
14+
*.sln.docstates
15+
*.user.sln*
16+
/test.ps1
17+
*.stackdump
18+
19+
# User-specific files (MonoDevelop/Xamarin Studio)
20+
*.userprefs
21+
22+
# Build results
23+
[Dd]ebug/
24+
[Dd]ebugPublic/
25+
[Rr]elease/
26+
[Rr]eleases/
27+
x64/
28+
x86/
29+
bld/
30+
[Bb]in/
31+
[Oo]bj/
32+
[Ll]og/
33+
34+
# Visual Studio 2015 cache/options directory
35+
.vs/
36+
# Uncomment if you have tasks that create the project's static files in wwwroot
37+
#wwwroot/
38+
39+
# BenchmarkDotNet Results
40+
[Bb]enchmarkDotNet.Artifacts/
41+
42+
# MSTest test Results
43+
[Tt]est[Rr]esult*/
44+
[Bb]uild[Ll]og.*
45+
46+
# NUNIT
47+
*.VisualState.xml
48+
TestResult.xml
49+
50+
# Build Results of an ATL Project
51+
[Dd]ebugPS/
52+
[Rr]eleasePS/
53+
dlldata.c
54+
55+
# .NET Core
56+
project.lock.json
57+
project.fragment.lock.json
58+
artifacts/
59+
#**/Properties/launchSettings.json
60+
61+
*_i.c
62+
*_p.c
63+
*_i.h
64+
*.ilk
65+
*.meta
66+
*.obj
67+
*.pch
68+
*.pdb
69+
*.pgc
70+
*.pgd
71+
*.rsp
72+
*.sbr
73+
*.tlb
74+
*.tli
75+
*.tlh
76+
*.tmp
77+
*.tmp_proj
78+
*.log
79+
*.vspscc
80+
*.vssscc
81+
.builds
82+
*.pidb
83+
*.svclog
84+
*.scc
85+
86+
# Chutzpah Test files
87+
_Chutzpah*
88+
89+
# Visual C++ cache files
90+
ipch/
91+
*.aps
92+
*.ncb
93+
*.opendb
94+
*.opensdf
95+
*.sdf
96+
*.cachefile
97+
*.VC.db
98+
*.VC.VC.opendb
99+
100+
# Visual Studio profiler
101+
*.psess
102+
*.vsp
103+
*.vspx
104+
*.sap
105+
106+
# TFS 2012 Local Workspace
107+
$tf/
108+
109+
# Guidance Automation Toolkit
110+
*.gpState
111+
112+
# ReSharper is a .NET coding add-in
113+
_ReSharper*/
114+
*.[Rr]e[Ss]harper
115+
*.DotSettings.user
116+
117+
# JustCode is a .NET coding add-in
118+
.JustCode
119+
120+
# TeamCity is a build add-in
121+
_TeamCity*
122+
123+
# DotCover is a Code Coverage Tool
124+
*.dotCover
125+
126+
# Visual Studio code coverage results
127+
*.coverage
128+
*.coveragexml
129+
130+
# NCrunch
131+
_NCrunch_*
132+
.*crunch*.local.xml
133+
nCrunchTemp_*
134+
135+
# MightyMoose
136+
*.mm.*
137+
AutoTest.Net/
138+
139+
# Web workbench (sass)
140+
.sass-cache/
141+
142+
# Installshield output folder
143+
[Ee]xpress/
144+
145+
# DocProject is a documentation generator add-in
146+
DocProject/buildhelp/
147+
DocProject/Help/*.HxT
148+
DocProject/Help/*.HxC
149+
DocProject/Help/*.hhc
150+
DocProject/Help/*.hhk
151+
DocProject/Help/*.hhp
152+
DocProject/Help/Html2
153+
DocProject/Help/html
154+
155+
# Click-Once directory
156+
publish/
157+
158+
# Publish Web Output
159+
*.[Pp]ublish.xml
160+
*.azurePubxml
161+
# TODO: Comment the next line if you want to checkin your web deploy settings
162+
# but database connection strings (with potential passwords) will be unencrypted
163+
*.pubxml
164+
*.publishproj
165+
166+
# Microsoft Azure Web App publish settings. Comment the next line if you want to
167+
# checkin your Azure Web App publish settings, but sensitive information contained
168+
# in these scripts will be unencrypted
169+
PublishScripts/
170+
171+
# NuGet Packages
172+
*.nupkg
173+
# The packages folder can be ignored because of Package Restore
174+
**/packages/*
175+
# except build/, which is used as an MSBuild target.
176+
!**/packages/build/
177+
# Uncomment if necessary however generally it will be regenerated when needed
178+
#!**/packages/repositories.config
179+
# NuGet v3's project.json files produces more ignorable files
180+
*.nuget.props
181+
*.nuget.targets
182+
183+
# Microsoft Azure Build Output
184+
csx/
185+
*.build.csdef
186+
187+
# Microsoft Azure Emulator
188+
ecf/
189+
rcf/
190+
191+
# Windows Store app package directories and files
192+
AppPackages/
193+
BundleArtifacts/
194+
Package.StoreAssociation.xml
195+
_pkginfo.txt
196+
197+
# Visual Studio cache files
198+
# files ending in .cache can be ignored
199+
*.[Cc]ache
200+
# but keep track of directories ending in .cache
201+
!*.[Cc]ache/
202+
203+
# Others
204+
ClientBin/
205+
~$*
206+
*~
207+
*.dbmdl
208+
*.dbproj.schemaview
209+
*.jfm
210+
*.pfx
211+
*.publishsettings
212+
orleans.codegen.cs
213+
214+
# Since there are multiple workflows, uncomment next line to ignore bower_components
215+
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
216+
#bower_components/
217+
218+
# RIA/Silverlight projects
219+
Generated_Code/
220+
221+
# Backup & report files from converting an old project file
222+
# to a newer Visual Studio version. Backup files are not needed,
223+
# because we have git ;-)
224+
_UpgradeReport_Files/
225+
Backup*/
226+
UpgradeLog*.XML
227+
UpgradeLog*.htm
228+
229+
# SQL Server files
230+
*.mdf
231+
*.ldf
232+
233+
# Business Intelligence projects
234+
*.rdl.data
235+
*.bim.layout
236+
*.bim_*.settings
237+
238+
# Microsoft Fakes
239+
FakesAssemblies/
240+
241+
# GhostDoc plugin setting file
242+
*.GhostDoc.xml
243+
244+
# Node.js Tools for Visual Studio
245+
.ntvs_analysis.dat
246+
node_modules/
247+
248+
# Typescript v1 declaration files
249+
typings/
250+
251+
# Visual Studio 6 build log
252+
*.plg
253+
254+
# Visual Studio 6 workspace options file
255+
*.opt
256+
257+
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
258+
*.vbw
259+
260+
# Visual Studio LightSwitch build output
261+
**/*.HTMLClient/GeneratedArtifacts
262+
**/*.DesktopClient/GeneratedArtifacts
263+
**/*.DesktopClient/ModelManifest.xml
264+
**/*.Server/GeneratedArtifacts
265+
**/*.Server/ModelManifest.xml
266+
_Pvt_Extensions
267+
268+
# Paket dependency manage
269+
.paket/paket.exe
270+
paket-files/
271+
272+
# FAKE - F# Make
273+
.fake/
274+
275+
# JetBrains Rider
276+
.idea/
277+
*.sln.iml
278+
279+
# CodeRush
280+
.cr/
281+
282+
# Python Tools for Visual Studio (PTVS)
283+
__pycache__/
284+
*.pyc
285+
286+
# Cake - Uncomment if you are using it
287+
# tools/**
288+
# !tools/packages.config
289+
290+
# Telerik's JustMock configuration file
291+
*.jmconfig
292+
293+
# BizTalk build output
294+
*.btp.cs
295+
*.btm.cs
296+
*.odx.cs
297+
*.xsd.cs
298+
299+
#DS Store
300+
.DS_Store
301+
302+
#ENV
303+
.env
304+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFramework>net7.0</TargetFramework>
5+
<ImplicitUsings>enable</ImplicitUsings>
6+
<Nullable>enable</Nullable>
7+
8+
<IsPackable>false</IsPackable>
9+
</PropertyGroup>
10+
11+
<ItemGroup>
12+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.2" />
13+
<PackageReference Include="xunit" Version="2.4.2" />
14+
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
15+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
16+
<PrivateAssets>all</PrivateAssets>
17+
</PackageReference>
18+
<PackageReference Include="coverlet.collector" Version="3.1.2">
19+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
20+
<PrivateAssets>all</PrivateAssets>
21+
</PackageReference>
22+
</ItemGroup>
23+
24+
<ItemGroup>
25+
<ProjectReference Include="..\QueryKit\QueryKit.csproj" />
26+
</ItemGroup>
27+
28+
</Project>

QueryKit.UnitTests/UnitTest1.cs

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
namespace QueryKit.UnitTests;
2+
3+
public class UnitTest1
4+
{
5+
public class Person
6+
{
7+
public string Title { get; set; }
8+
public int Age { get; set; }
9+
public string BirthMonth { get; set; }
10+
public decimal Rating { get; set; }
11+
public DateOnly Date { get; set; }
12+
public bool Favorite { get; set; }
13+
public DateTimeOffset SpecificDate { get; set; }
14+
public TimeOnly Time { get; set; }
15+
}
16+
17+
[Fact]
18+
public void Test1()
19+
{
20+
var input =
21+
"((Title @=* waffle && Age > 30) || Title == lamb) && (Age < 18 || (BirthMonth == January && Title _= ally)) || Rating > 3.5 || SpecificDate == 2022-07-01T00:00:03Z && (Date == 2022-07-01 || Time == 00:00:03)";
22+
23+
// TODO support bool without `==` and with a not???
24+
25+
// input = "Title @=* waffle";
26+
// input = "(Title @=* waffle || Age > 30) || Age < 18";
27+
// input = "Title @=* waffle || Age > 30";
28+
var filterExpression = FilterParser.ParseFilter<Person>(input);
29+
Console.WriteLine(filterExpression);
30+
}
31+
}

QueryKit.UnitTests/Usings.cs

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
global using Xunit;

QueryKit.sln

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "QueryKit", "QueryKit\QueryKit.csproj", "{A6A443BB-45D5-46C9-B419-07BE36BD50F0}"
4+
EndProject
5+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "QueryKit.UnitTests", "QueryKit.UnitTests\QueryKit.UnitTests.csproj", "{44664CB7-E20F-40BA-A3D8-D201BD45FC58}"
6+
EndProject
7+
Global
8+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
9+
Debug|Any CPU = Debug|Any CPU
10+
Release|Any CPU = Release|Any CPU
11+
EndGlobalSection
12+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
13+
{A6A443BB-45D5-46C9-B419-07BE36BD50F0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
14+
{A6A443BB-45D5-46C9-B419-07BE36BD50F0}.Debug|Any CPU.Build.0 = Debug|Any CPU
15+
{A6A443BB-45D5-46C9-B419-07BE36BD50F0}.Release|Any CPU.ActiveCfg = Release|Any CPU
16+
{A6A443BB-45D5-46C9-B419-07BE36BD50F0}.Release|Any CPU.Build.0 = Release|Any CPU
17+
{44664CB7-E20F-40BA-A3D8-D201BD45FC58}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
18+
{44664CB7-E20F-40BA-A3D8-D201BD45FC58}.Debug|Any CPU.Build.0 = Debug|Any CPU
19+
{44664CB7-E20F-40BA-A3D8-D201BD45FC58}.Release|Any CPU.ActiveCfg = Release|Any CPU
20+
{44664CB7-E20F-40BA-A3D8-D201BD45FC58}.Release|Any CPU.Build.0 = Release|Any CPU
21+
EndGlobalSection
22+
EndGlobal

0 commit comments

Comments
 (0)