public static TransactionViewData ToTransactionMinimalViewData(this Transaction Objectsource)
        {
            var newTransactionViewData = new TransactionViewData();

            newTransactionViewData.Id = Objectsource.ID;
            newTransactionViewData.Name = Objectsource.Name;
            newTransactionViewData.Description = Objectsource.Description;
            newTransactionViewData.Amount = Objectsource.Amount;
            newTransactionViewData.CreatedDate = Objectsource.CreatedDate.ToShortDateString();

            return newTransactionViewData;
        }
        public static TransactionViewData ToTransactionViewData(this Transaction Objectsource, bool OnDetails)
        {
            var newTransactionViewData = new TransactionViewData();

            newTransactionViewData.Id = Objectsource.ID;
            newTransactionViewData.Name = Objectsource.Name;

            if (Objectsource.Account != null && OnDetails)
                newTransactionViewData.Account = Objectsource.Account.ToAccountViewData() ;

            if (Objectsource.Category != null && OnDetails)
                newTransactionViewData.Category = Objectsource.Category.ToCategoryViewData();


            newTransactionViewData.Description = Objectsource.Description;
            newTransactionViewData.Amount = Objectsource.Amount;
            newTransactionViewData.CreatedDate = Objectsource.CreatedDate.ToShortDateString();

            return newTransactionViewData;

        }