Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
UpdateObject.cs
1using System;
5using System.Threading.Tasks;
6
8{
13 {
23 {
24 }
25
29 public override string FunctionName => nameof(UpdateObject);
30
34 public override string[] DefaultArgumentNames => new string[] { "Object" };
35
40 public override bool IsAsynchronous => true;
41
49 {
50 return this.EvaluateScalarAsync(Argument, Variables).Result;
51 }
52
59 public override async Task<IElement> EvaluateScalarAsync(IElement Argument, Variables Variables)
60 {
61 await Database.Update(Argument.AssociatedObjectValue);
62 return Argument;
63 }
64
65 }
66}
Static interface for database persistence. In order to work, a database provider has to be assigned t...
Definition: Database.cs:19
static async Task Update(object Object)
Updates an object in the database.
Definition: Database.cs:626
Class managing a script expression.
Definition: Expression.cs:39
Base class for funcions of one scalar variable.
ScriptNode Argument
Function argument.
Base class for all nodes in a parsed script tree.
Definition: ScriptNode.cs:69
int Length
Length of expression covered by node.
Definition: ScriptNode.cs:101
int Start
Start position in script expression.
Definition: ScriptNode.cs:92
Updates an object in the object database.
Definition: UpdateObject.cs:13
override string[] DefaultArgumentNames
Default Argument names
Definition: UpdateObject.cs:34
override string FunctionName
Name of the function
Definition: UpdateObject.cs:29
override bool IsAsynchronous
If the node (or its decendants) include asynchronous evaluation. Asynchronous nodes should be evaluat...
Definition: UpdateObject.cs:40
override async Task< IElement > EvaluateScalarAsync(IElement Argument, Variables Variables)
Evaluates the function on a scalar argument.
Definition: UpdateObject.cs:59
UpdateObject(ScriptNode Argument, int Start, int Length, Expression Expression)
Updates an object in the object database.
Definition: UpdateObject.cs:21
override IElement EvaluateScalar(IElement Argument, Variables Variables)
Evaluates the function on a scalar argument.
Definition: UpdateObject.cs:48
Collection of variables.
Definition: Variables.cs:25
Basic interface for all types of elements.
Definition: IElement.cs:20