Exemplo n.º 1
0
        public TransactionViewModel CreateTransaction(TransactionViewModel model)
        {
            var entity = model.ToEntity();

            this.BaseService.Create(entity);
            model.Id = entity.Id;
            return(model);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Delete an entity.
        /// </summary>
        /// <param name="model"></param>
        public void Delete(TransactionViewModel model)
        {
            var entity = model.ToEntity();

            this._TransactionsRepository.Delete(entity);

            #region Commit Changes
            this._unitOfWork.Commit();
            #endregion
        }
Exemplo n.º 3
0
        /// <summary>
        /// Update an entity.
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public TransactionViewModel Update(TransactionViewModel model)
        {
            this.ThrowExceptionIfExist(model);

            var entity = model.ToEntity();

            entity = this._TransactionsRepository.Update(entity);

            #region Commit Changes
            this._unitOfWork.Commit();
            #endregion

            model = entity.ToModel();
            return(model);
        }