Skip to content

Commit 13b0143

Browse files
authored
Fix indexing and querying GUID lists (#403)
1 parent ffb3a40 commit 13b0143

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Redis.OM/Common/ExpressionParserUtilities.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -837,7 +837,7 @@ private static string TranslateContainsStandardQuerySyntax(MethodCallExpression
837837
var treatEnumsAsInts = type.IsEnum && !(propertyExpression.Member.GetCustomAttributes(typeof(JsonConverterAttribute)).FirstOrDefault() is JsonConverterAttribute converter && converter.ConverterType == typeof(JsonStringEnumConverter));
838838
literal = GetOperandStringForQueryArgs(valuesExpression, treatEnumsAsInts);
839839

840-
if ((type == typeof(string) || type == typeof(string[]) || type == typeof(List<string>) || type == typeof(Guid) || type == typeof(Ulid) || (type.IsEnum && !treatEnumsAsInts)) && attribute is IndexedAttribute)
840+
if ((type == typeof(string) || type == typeof(string[]) || type == typeof(List<string>) || type == typeof(Guid) || type == typeof(Guid[]) || type == typeof(List<Guid>) || type == typeof(Ulid) || (type.IsEnum && !treatEnumsAsInts)) && attribute is IndexedAttribute)
841841
{
842842
return $"({memberName}:{{{EscapeTagField(literal).Replace("\\|", "|")}}})";
843843
}

src/Redis.OM/Modeling/RedisSchemaField.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ internal static string[] SerializeArgs(this PropertyInfo info)
104104
return ret.ToArray();
105105
}
106106

107-
private static bool IsTypeIndexableArray(Type t) => t == typeof(string[]) || t == typeof(bool[]) || t == typeof(List<string>) || t == typeof(List<bool>);
107+
private static bool IsTypeIndexableArray(Type t) => t == typeof(string[]) || t == typeof(bool[]) || t == typeof(Guid[]) || t == typeof(List<string>) || t == typeof(List<bool>) || t == typeof(List<Guid>);
108108

109109
private static IEnumerable<string> SerializeIndexFromJsonPaths(PropertyInfo parentInfo, SearchFieldAttribute attribute, string prefix = "$.", string aliasPrefix = "", int remainingDepth = -1)
110110
{

0 commit comments

Comments
 (0)