/// <summary> /// 添加 /// </summary> /// qiy 16.03.30 /// <param name="value">值</param> /// <returns></returns> public bool Add(AccountInfo value) { bool result = true; using (TransactionScope scope = new TransactionScope()) { result &= _user.Add(value); if (result) { accountMapper.Insert(value); } if (result) { scope.Complete(); } } return(result); }
public IHttpActionResult Post(UserInfo value) { return(_user.Add(value) ? (IHttpActionResult)Ok() : BadRequest("保存失败")); }