Skip to content

Commit a89f3fe

Browse files
Create DBHasKeyMethod.cs
1 parent bd41f57 commit a89f3fe

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)