public object GetLast() { var lastCountTransactions = BitcoinService.GetLastCountTransactions(); var countTransactions = BitcoinService.GetBlockCount(); var allTransactions = BitcoinService.GetAllTransactions(); var receiveTransactions = BitcoinService.SeparateFromTypeTransactions(allTransactions)["receive"]; if (lastCountTransactions < countTransactions) { return(allTransactions.Skip(lastCountTransactions).Select(x => new { Date = x.BlockTime, Address = x.Address, Amount = x.Amount, Confirmation = x.Confirmation })); } else { return(receiveTransactions.Where(x => x.Confirmation < 3).Select(x => new { Date = x.BlockTime, Address = x.Address, Amount = x.Amount, Confirmation = x.Confirmation })); } }