示例#1
0
        public void DeleteSave(AccountBO accountBO)
        {
            var account = mapper.Map <Account>(accountBO);

            unitOfWork.Accounts.Delete(account.Id);
            unitOfWork.Accounts.Save();
        }
示例#2
0
        public void Save(AccountBO accountBO)
        {
            var account = mapper.Map <Account>(accountBO);

            if (accountBO.Id == 0 || account.Id == null)      //почему Null??????????????
            {
                Add(account);
            }
            else
            {
                Update(account);
            }
            unitOfWork.Accounts.Save();
        }