private void SendSmsMessage(string mobile, VerifyType verifyType, string code) { ExceptionHelper.ThrowIfNullOrEmpty(mobile, "mobile"); ExceptionHelper.ThrowIfNullOrEmpty(code, "code"); using (var scope = new System.Transactions.TransactionScope()) { var history = new Data.SmsHistory { content = String.Format("发送手机验证码:{0}", code), created = DateTime.Now, mobile = mobile.Trim(), }; _SmsHistoryRepository.Add(history); _SmsHistoryRepository.SaveChanges(); //TODO:发送信息 scope.Complete(); } }