Ejemplo n.º 1
0
        private List <ShareSold> Sell(int amount, float shareValue, int year, string transactionId)
        {
            var spec = new ShareStateSpecification(Share.ShareState.Vested);

            return(this.sharesRepository
                   .Get(spec)
                   .Take(amount)
                   .Select(share => share.Sell(shareValue, year, transactionId))
                   .ToList());
        }
Ejemplo n.º 2
0
        public async Task <GetSharesResult> Handle(GetShares cmd, CancellationToken cancellationToken)
        {
            var spec = new ShareStateSpecification(cmd.State);

            var shares = this.sharesRepository
                         .Get(spec)
                         .ToList();

            var result = new GetSharesResult
            {
                Shares = shares
            };

            return(await Task.FromResult(result));
        }