public DualTransactionCommand( IStorageStore storageStore, IEventStore eventStore, ITransactionValidationService transactionValidationService, DualTransactionData data) { this.storageStore = storageStore; this.eventStore = eventStore; this.transactionValidationService = transactionValidationService; this.data = data; }
public async Task <IActionResult> MoveItemAsync(DualTransactionData transaction) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } var command = commandFactory.GetDualTransactionCommand(transaction); try { await command.ExecuteAsync(); } catch (NotAuthorizedException) { return(Forbid()); } catch (ValidationException) { return(BadRequest()); } return(Ok()); }
public ICommand GetDualTransactionCommand(DualTransactionData data) { return(new DualTransactionCommand(storageStore, eventStore, transactionValidationService, data)); }