File tree Expand file tree Collapse file tree 2 files changed +24
-0
lines changed
MethodSystem/Methods/DatabaseMethods Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -94,6 +94,7 @@ value is DynamicTextValue
9494 public void RemoveKey ( string key , bool save = true )
9595 {
9696 _db . Remove ( key ) ;
97+ if ( save ) Save ( ) ;
9798 }
9899
99100 public TryGet < DatabaseValue > HasKey ( string key )
Original file line number Diff line number Diff line change 1+ using JetBrains . Annotations ;
2+ using SER . Code . ArgumentSystem . Arguments ;
3+ using SER . Code . ArgumentSystem . BaseArguments ;
4+ using SER . Code . MethodSystem . BaseMethods . Synchronous ;
5+
6+ namespace SER . Code . MethodSystem . Methods . DatabaseMethods ;
7+
8+ [ UsedImplicitly ]
9+ public class RemoveDBKeyMethod : SynchronousMethod
10+ {
11+ public override string Description => "Removes a key from a database." ;
12+
13+ public override Argument [ ] ExpectedArguments { get ; } =
14+ [
15+ new DatabaseArgument ( "database" ) ,
16+ new TextArgument ( "key" )
17+ ] ;
18+
19+ public override void Execute ( )
20+ {
21+ Args . GetDatabase ( "database" ) . RemoveKey ( Args . GetText ( "key" ) ) ;
22+ }
23+ }
You can’t perform that action at this time.
0 commit comments