public async Task <Math2Values> Put(int id, [FromBody] Math2Values values) { await Task.Delay(1000); return(new Math2Values() { x = values.x / id, y = values.y }); }
private Math2Values ExecuteOperation(Operation op, int x, Math2Values data) { switch (op) { case TestBlocklyHtml.Operation.Add: return(data + x); case TestBlocklyHtml.Operation.Substraction: return(data - x); case TestBlocklyHtml.Operation.Divide: return(data / x); case TestBlocklyHtml.Operation.Multiply: return(data * x); default: throw new ArgumentException($"unknown operation {op}"); } }
public async Task <double> Post([FromBody] Math2Values values) { await Task.Delay(1000); return((double)values.x / (double)values.y); }
public int Operations(Operation id, [FromBody] Math2Values data) { return(data.x / data.y); }
public int Divide([FromBody] Math2Values data) { return(data.x / data.y); }
public int Add([FromBody] Math2Values data) { return(data.x + data.y); }
public Math2Values Operation(Operation id, int x, [FromBody] Math2Values data) { return(ExecuteOperation(id, x, data)); }
private Math2Values ExecuteOperation(Operation op, int x, Math2Values data) { return(null); }