Ejemplo n.º 1
0
        public OperationResult ApplyOperation(IOperation operation)
        {
            try
            {
                var account         = GetAccountFromId(operation.AccountId);
                var operationResult = operation.ApplyOn(account);

                if (operationResult.Status == OperationStatus.Done)
                {
                    _store.SaveOperation(operationResult.Result);
                }

                return(operationResult);
            }
            catch (Exception e)
            {
                return(OperationResult.AsFailed(e.Message));
            }
        }