Skip to content

Commit

Permalink
devexteme array any
Browse files Browse the repository at this point in the history
  • Loading branch information
coronabytes committed Jul 23, 2023
1 parent 66849e0 commit a08d06b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 9 additions & 1 deletion Core.Arango.DevExtreme/ArangoTransform.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Security.Principal;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
Expand Down Expand Up @@ -628,7 +629,7 @@ private string GetMatchingFilter(IList dxFilter, bool not = false)
case "endswith":
opString = "ENDSWITH";
break;
case "in":
case "in": // TODO: deprecated
opString = "IN";
break;
default:
Expand All @@ -654,13 +655,20 @@ private string GetMatchingFilter(IList dxFilter, bool not = false)

var realPropertyName = _settings.ValidPropertyName(dxFilter[0].ToString()).FirstCharOfPropertiesToUpper();

if (_settings.ArrayProperties.Contains(realPropertyName))
{
if (opString == "==")
opString = "ANY ==";
}

string property;

if (_settings.ExtractFilters.TryGetValue(realPropertyName, out var extract1))
property = PropertyName(extract1.Property, extract1.IteratorVar);
else
property = PropertyName(realPropertyName);



string boundParam = null;

Expand Down
2 changes: 2 additions & 0 deletions Core.Arango.DevExtreme/ArangoTransformSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ public class ArangoTransformSettings
/// </summary>
public Func<string, ArangoTransformSettings, string> PropertyTransform { get; set; }

public HashSet<string> ArrayProperties { get; set; } = new();

/// <summary>
/// When true (default) always sort by _key last if not already present
/// </summary>
Expand Down

0 comments on commit a08d06b

Please sign in to comment.