public async Task Execute(ICloudCmd command) { if (command.GetType().IsSubclassOf(typeof(EmailTemplateCmd)) || command.GetType() == typeof(EmailTemplateCmd)) { if (command is EmailTemplateCmd output) { output.Result = (ActionConfirm)Result.Object.Execute(command); await Register(); } } else if (command.GetType().IsSubclassOf(typeof(UploadCmd)) || command.GetType() == typeof(UploadCmd)) { if (command is UploadCmd output) { output.Confirm = (ActionConfirm)Result.Object.Execute(command); output.Result = output.Confirm; await Register(); } } else if (command.GetType().IsSubclassOf(typeof(DeleteCmd)) || command.GetType() == typeof(DeleteCmd)) { if (command is DeleteCmd output) { output.Confirm = (ActionConfirm)Result.Object.Execute(command); output.Result = output.Confirm; await Register(); } } else if (command.GetType().IsSubclassOf(typeof(GiphyCmd)) || command.GetType() == typeof(GiphyCmd)) { if (command is GiphyCmd output) { output.Result = (ActionConfirm)Result.Object.Execute(command); output.ImageUrl = "https://image.com/img.jpg"; await Register(); } } else { await Register(); } }
public async Task Execute(ICloudCmd command) { command.Settings = Settings; await command.Execute(); }