public dynamic GetStockAccountTransaction(string stockAccountId, string transactionId)
        {
            List <StockAccountTransaction>    stockAccountTransaction;
            List <StockAccountTransactionDto> stockAccountTransactionDtos = new List <StockAccountTransactionDto>();

            stockAccountTransaction = stocky.StockAccountTransaction.ToList();

            if (stockAccountId == null && transactionId != null)
            {
                stockAccountTransaction = stocky.StockAccountTransaction.Where(e => e.StockAccountId == stockAccountId).ToList();
            }
            else if (stockAccountId == null && transactionId != null)
            {
                stockAccountTransaction = stocky.StockAccountTransaction.Where(e => e.TransactionId == transactionId).ToList();
            }
            else if (stockAccountId == null && transactionId == null)
            {
                stockAccountTransaction = stocky.StockAccountTransaction.ToList();
            }
            else
            {
                stockAccountTransaction = stocky.StockAccountTransaction.Where(e => e.StockAccountId == stockAccountId && e.TransactionId == transactionId).ToList();
            }


            foreach (StockAccountTransaction com in stockAccountTransaction)
            {
                StockAccountTransactionDto dto = new StockAccountTransactionDto(
                    com.Id, com.StockAccountId, com.TransactionId);
                stockAccountTransactionDtos.Add(dto);
            }
            return(stockAccountTransactionDtos);
        }
        public void PostStockAccountTransaction([FromBody] StockAccountTransactionDto stockAccountTransactionDto)
        {
            StockAccountTransaction com = new StockAccountTransaction();

            com.Id             = stockAccountTransactionDto.Id;
            com.StockAccountId = stockAccountTransactionDto.StockAccountId;
            com.TransactionId  = stockAccountTransactionDto.TransactionId;
            stocky.StockAccountTransaction.Add(com);
            stocky.SaveChanges();
        }
        public void PutStockAccountTransaction(String id, [FromBody] StockAccountTransactionDto stockAccountTransactionDto)
        {
            //  stocky.Company.Update(id, com);
            StockAccountTransaction com = stocky.StockAccountTransaction.Where(e => e.Id == stockAccountTransactionDto.Id).Single <StockAccountTransaction>();

            com.Id                  = stockAccountTransactionDto.Id;
            com.StockAccountId      = stockAccountTransactionDto.StockAccountId;
            com.TransactionId       = stockAccountTransactionDto.TransactionId;
            stocky.Entry(com).State = Microsoft.EntityFrameworkCore.EntityState.Modified;
            stocky.SaveChanges();
        }