public TransactionImageList GetImagesForTransaction(int transactionId)
        {
            TransactionImageList result = new TransactionImageList();
            using(EntityContext context = new EntityContext())
            {
                var query = context.TransactionImage
                                    .Include(x => x.Transaction)
                                    .Include(x => x.CreatedUser)
                                    .Include(x => x.ModifiedUser)
                                    .Where(x =>x.Transaction.TransactionId == transactionId && !x.IsDeleted);

                query.ToList().ForEach(x=> 
                {
                    x.Transaction.TransactionImages = null;
                    result.Add(x);
                });
                result.AcceptChanges();


            }
            return result;
        }
        private static void SaveTransactionImages(ServiceReference1.MainClient a, User usr)
        {
            var transactions = a.GetAllTransactions(usr.UserId);
            var trans = transactions[0];
            var transWithImages = transactions.FirstOrDefault(x => x.TransactionId == 11132);
            var transImages = a.GetImagesForTransaction(transWithImages.TransactionId);
            
            var transImage = new TransactionImage(usr)
            {
                Transaction = trans,
                Path = "/Assets/login_white.png",
                Name = string.Format("{0} [{1}]", "aaaa", "bbbb"),
                Image = transImages[0].Image,
                Thumbnail = transImages[0].Image
            };

            var transImageList = new TransactionImageList();
            transImageList.Add(transImage);

            transImages.Add(transImage);
            trans.TransactionImages = (TransactionImageList)transImages;
            trans.ModifiedDate = DateTime.Now;
            trans.OptimizeOnTopLevel(Transaction.ImageRemovalStatus.Unchanged);

            a.SaveTransactions(new ObservableCollection<Transaction> { trans });
//            a.SaveTransactionImages(transImages);
        }