public IActionResult GetEventParticipants([FromBody] Event _event) { BaseResult <UserModel> baseResult = new BaseResult <UserModel>(); baseResult.data.users = _SEventParticipant.GetEventParticipants(_event.id); return(Json(baseResult)); }
private void EventTick(object state) { if (!Monitor.TryEnter(state)) { return; } if (_SSmtp != null) { do { EventQueueModel eventQueueModel; eventQueues.TryDequeue(out eventQueueModel); if (eventQueueModel != null) { Event _event = _SEvent.GetById(eventQueueModel.eventId); List <User> eventParticipants = _SEventParticipant.GetEventParticipants(_event.id); foreach (var item in eventParticipants) { MailEntity mailEntity = new MailEntity() { subject = String.Format("{0} Etkinliği Hakkında Bilgilendirme", _event.name), body = eventQueueModel.message, to = item.email }; Task.Run(() => _SSmtp.SendAsync(mailEntity)); string _json = JsonConvert.SerializeObject(mailEntity); Console.WriteLine(String.Format("Event Bildirim Gönderiliyor!\n{0}", _json)); } } } while (eventQueues.Count > 0); } Monitor.Exit(state); }