We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bd41f57 commit a89f3feCopy full SHA for a89f3fe
MethodSystem/Methods/DatabaseMethods/DBHasKeyMethod.cs
@@ -0,0 +1,22 @@
1
+using SER.ArgumentSystem.Arguments;
2
+using SER.ArgumentSystem.BaseArguments;
3
+using SER.MethodSystem.BaseMethods;
4
+using SER.ValueSystem;
5
+
6
+namespace SER.MethodSystem.Methods.DatabaseMethods;
7
8
+public class DBHasKeyMethod : ReturningMethod<BoolValue>
9
+{
10
+ public override string? Description => "Returns true if the provided key exists in the database.";
11
12
+ public override Argument[] ExpectedArguments =>
13
+ [
14
+ new DatabaseArgument("database"),
15
+ new TextArgument("key")
16
+ ];
17
18
+ public override void Execute()
19
+ {
20
+ ReturnValue = Args.GetDatabase("database").HasKey(Args.GetText("key")).WasSuccessful();
21
+ }
22
+}
0 commit comments