public void FreshList(ShortMessageModel ShortMessageModel) { ShortMessageModel message = list.Where(x => x.Mobile == ShortMessageModel.Mobile).FirstOrDefault(); if (list.Remove(message)) { EnList(ShortMessageModel); } }
public ShortMessageModel Post([FromBody] IncomingShortMessageModel incomingMessage) { if (incomingMessage == null) { return(new ShortMessageModel()); } ShortMessageModel shortMessageModel = new ShortMessageModel() { Created = DateTime.Now, Text = incomingMessage.Text }; var consumer = valueRepository.Get(incomingMessage.ConsumerKey); //Consumer does not exist if (consumer == null) { consumer = new ConsumerModel(); consumer.Key = incomingMessage.ConsumerKey; consumer.Secret = incomingMessage.ConsumerSecret; consumer.ShortMessages.Add(shortMessageModel); valueRepository.Update(consumer); } else { //Consumer already exists, check secret if (consumer.Secret == incomingMessage.ConsumerSecret) { consumer.ShortMessages.Add(shortMessageModel); valueRepository.Update(consumer); } } return(shortMessageModel); }
public void FreshList(ShortMessageModel ShortMessageModel) { return; }
public void EnList(ShortMessageModel ShortMessageModel) { return; }
public void EnList(ShortMessageModel ShortMessageModel) { list.Add(ShortMessageModel); }
public void DeList(ShortMessageModel ShortMessageModel) { list.Remove(ShortMessageModel); }
public IActionResult ResponseAddMessage([FromServices] MessageService messageService, ShortMessageModel data) { messageService.AddMessage(data); this.TempData["responseAddMessage"] = "Add message success"; return(RedirectToAction("Message")); }