protected override void OnHandleIntent(Intent intent)
        {
            var bundle = intent.GetBundleExtra(nameof(SetWorkoutAsExecuted));
            var cmd    = new SetWorkoutAsExecuted(new Guid(bundle.GetString(nameof(SetWorkoutAsExecuted.Id))));
            var task   = workoutService.ExecuteCommand(cmd);

            task.ContinueWith(_ => BroadcastSuccess(cmd.Id), TaskContinuationOptions.OnlyOnRanToCompletion);
            task.ContinueWith(_ => BroadcastFailure(cmd.Id), TaskContinuationOptions.OnlyOnFaulted);
        }
Ejemplo n.º 2
0
 public async Task When(SetWorkoutAsExecuted cmd)
 {
     await Update(new WorkoutId(cmd.Id), w => w.Execute(DateTime.Now));
 }