異步發送
阿新 • • 發佈:2018-05-28
actor sage == ins use exceptio dao tar exce
/// <summary> /// 發送 改成異步發送了 /// </summary> /// <param name="userList"></param> /// <param name="message"></param> /// <param name="title"></param> /// <param name="notifyenum"></param> privatestatic void Notify(NotifyContext noticontext, List<IssuedType> notifyenum) { Task.Factory.StartNew(() => { try { notifyenum.ForEach(p => { BaseNotifier noti= null; #region 實例 //郵件 if (p == IssuedType.Mail) { noti = new MailNotifier(); } //App if (p == IssuedType.App) { noti= new AppNotifier(); } //短信 if (p == IssuedType.SMS) { noti = new SMSNotifier(); } #endregion #region 賦值發送 if (noti != null) { noti.Context = noticontext; noti.Notify(); } #endregion }); } catch (Exception ex) { Dao.Get().ExecuteNonQuery("insert into vinson_msg(msg) values(‘" + ex.Message + "‘)"); } }); }
異步發送