Exemple #1
0
        /// <summary>
        /// Delete from database specified Account
        /// </summary>
        /// <returns></returns>
        public ResultServiceOperation<AccountDomain> Delete(AccountDomain entity)
        {
            var rezult = new ResultServiceOperation<AccountDomain>();

            try
            {
                Account dbEntity = Mapper.Map<Account>(entity);

                _accountRepository.Delete(dbEntity);

                _accountRepository.SaveChanges();
            }
            catch (Exception exc)
            {
                rezult.Errors.Add(string.Empty, exc.Message);
            }

            return rezult;
        }
Exemple #2
0
        //
        public ResultServiceOperation<AccountDomain> GetAll()
        {
            var rezult = new ResultServiceOperation<AccountDomain>();

            var listAccount = _accountRepository.GetAll().ToList<Account>();

            List<AccountDomain> list = Mapper.Map<List<Account>, List<AccountDomain>>(listAccount);

            rezult.Data = list;

            return rezult;
        }