public TransactionDetailDomainEntity CreateTransactionDetail(TransactionDirection transactionDirection) { string description = ApiUtils.GenerateTransactionDescription( transactionDirection, FromTransactionOwner, ToTransactionOwner, Amount); if (transactionDirection == TransactionDirection.In) { return(coreContext.New <TransactionDetailDomainEntity>() .With(description, TransactionDate, this, (ITransactionDetailOwner)FromTransactionOwner, transactionDirection)); } else { return(coreContext.New <TransactionDetailDomainEntity>() .With(description, TransactionDate, this, (ITransactionDetailOwner)ToTransactionOwner, transactionDirection)); } }