Skip to content

Commit

Permalink
support net standard 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Jamess-Lucass committed Jul 13, 2024
1 parent 13a43b9 commit 10420f9
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/GoatQuery/src/Ast/ExpressionStatement.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
public sealed class ExpressionStatement : Statement
{
public InfixExpression Expression { get; set; } = default!;
public InfixExpression Expression { get; set; } = default;

public ExpressionStatement(Token token) : base(token)
{
Expand Down
4 changes: 2 additions & 2 deletions src/GoatQuery/src/Ast/InfixExpression.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
public sealed class InfixExpression : QueryExpression
{
public QueryExpression Left { get; set; } = default!;
public QueryExpression Left { get; set; } = default;
public string Operator { get; set; } = string.Empty;
public QueryExpression Right { get; set; } = default!;
public QueryExpression Right { get; set; } = default;

public InfixExpression(Token token, QueryExpression left, string op) : base(token)
{
Expand Down
4 changes: 2 additions & 2 deletions src/GoatQuery/src/Evaluator/FilterEvaluator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

public static class FilterEvaluator
{
public static Expression? Evaluate(QueryExpression expression, ParameterExpression parameterExpression)
public static Expression Evaluate(QueryExpression expression, ParameterExpression parameterExpression)
{
switch (expression)
{
Expand All @@ -20,7 +20,7 @@ public static class FilterEvaluator
throw new GoatQueryException($"Invalid property '{exp.Left.TokenLiteral()}' within filter");
}

ConstantExpression? value = null;
ConstantExpression value = null;

switch (exp.Right)
{
Expand Down
2 changes: 1 addition & 1 deletion src/GoatQuery/src/Extensions/QueryableExtension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

public static class QueryableExtension
{
public static (IQueryable<T>, int?) Apply<T>(this IQueryable<T> queryable, Query query, ISearchBinder<T>? searchBinder = null, QueryOptions? options = null)
public static (IQueryable<T>, int?) Apply<T>(this IQueryable<T> queryable, Query query, ISearchBinder<T> searchBinder = null, QueryOptions options = null)
{
if (query.Top > options?.MaxTop)
{
Expand Down
3 changes: 1 addition & 2 deletions src/GoatQuery/src/GoatQuery.csproj
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard2.1</TargetFrameworks>
<TargetFrameworks>netstandard2.0</TargetFrameworks>
<RootNamespace>GoatQuery</RootNamespace>
<Nullable>enable</Nullable>

<PackageId>GoatQuery</PackageId>
<PackageReadmeFile>README.md</PackageReadmeFile>
Expand Down
4 changes: 2 additions & 2 deletions src/GoatQuery/src/Parser/Parser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
public sealed class QueryParser
{
private readonly QueryLexer _lexer;
private Token _currentToken { get; set; } = default!;
private Token _peekToken { get; set; } = default!;
private Token _currentToken { get; set; } = default;
private Token _peekToken { get; set; } = default;

public QueryParser(QueryLexer lexer)
{
Expand Down
6 changes: 3 additions & 3 deletions src/GoatQuery/src/Query.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ public sealed class Query
public int? Top { get; set; }
public int? Skip { get; set; }
public bool? Count { get; set; }
public string? OrderBy { get; set; } = string.Empty;
public string? Search { get; set; } = string.Empty;
public string? Filter { get; set; } = string.Empty;
public string OrderBy { get; set; } = string.Empty;
public string Search { get; set; } = string.Empty;
public string Filter { get; set; } = string.Empty;
}

0 comments on commit 10420f9

Please sign in to comment.