Skip to content

Commit 9e7a321

Browse files
committed
Add new 1.3 queries
1 parent 31c7827 commit 9e7a321

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

templates/dotnet/src/Appwrite/Query.cs.twig

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System.Collections;
22
using System.Collections.Generic;
3+
using System.Linq;
34

45
namespace Appwrite
56
{
@@ -40,6 +41,46 @@ namespace Appwrite
4041
return AddQuery(attribute, "search", value);
4142
}
4243

44+
public static string IsNull(string attribute)
45+
{
46+
return $"isNull(\"{attribute}\")";
47+
}
48+
49+
public static string IsNotNull(string attribute)
50+
{
51+
return $"isNotNull(\"{attribute}\")";
52+
}
53+
54+
public static string StartsWith(string attribute, string value)
55+
{
56+
return AddQuery(attribute, "startsWith", value);
57+
}
58+
59+
public static string EndsWith(string attribute, string value)
60+
{
61+
return AddQuery(attribute, "endsWith", value);
62+
}
63+
64+
public static string Between(string attribute, string start, string end)
65+
{
66+
return AddQuery(attribute, "between", new List<string> { start, end });
67+
}
68+
69+
public static string Between(string attribute, int start, int end)
70+
{
71+
return AddQuery(attribute, "between", new List<int> { start, end });
72+
}
73+
74+
public static string Between(string attribute, double start, double end)
75+
{
76+
return AddQuery(attribute, "between", new List<double> { start, end });
77+
}
78+
79+
public static string Select(List<string> attributes)
80+
{
81+
return $"select([{string.Join(",", attributes.Select(attribute => $"\"{attribute}\""))}])";
82+
}
83+
4384
public static string CursorAfter(string documentId)
4485
{
4586
return $"cursorAfter(\"{documentId}\")";

0 commit comments

Comments
 (0)