Exemple #1
0
 public Task <ApiResponse <bool> > Bulk(string id, WriteMeasureDto dto)
 {
     return(Catch(async() =>
     {
         var command = new UpdateMeasureCommand(Uri.UnescapeDataString(id), dto.Name, dto.Position);
         await MessageBus.DispatchCommand(command);
         return true;
     }));
 }
Exemple #2
0
 public Task <ApiResponse <string> > AddNew(WriteMeasureDto dto)
 {
     return(Catch(async() =>
     {
         ThrowIfModelInvalid();
         var command = new AddMeasureCommand(dto.Name, dto.Position);
         var result = await MessageBus.DispatchCommand(command);
         return result.Payload;
     }));
 }