public async Task <bool> EditLastMessageAsync(LastMessageDTO lastmessage) { var path = Properties.Resources.editLastMessagePath; var result = await _apiHelper.Put(path, lastmessage); return(result != null && result.ResponseType == ResponseType.Success); }
public void AddLastMessage(LastMessageDTO lastMessageDTO) { var lastMessage = MapperExtension.mapper.Map <LastMessageDTO, LastMessage>(lastMessageDTO); _db.LastMessages.Add(lastMessage); _db.SaveChanges(); }
public void EditLastMessage(LastMessageDTO lastMessageDTO) { var lastMessage = MapperExtension.mapper.Map <LastMessageDTO, LastMessage>(lastMessageDTO); _db.Entry(_db.LastMessages.Find(lastMessageDTO.PairId)).CurrentValues.SetValues(lastMessage); _db.SaveChanges(); }
public bool EditLastMessage(LastMessageDTO lastMessage) { try { _repository.EditLastMessage(lastMessage); } catch { return(false); } return(true); }
public IHttpActionResult EditLastMessage([FromBody] LastMessageDTO lastmessage) { if (string.IsNullOrEmpty(lastmessage.LastMessage1)) { return(BadRequest()); } if (_bll.EditLastMessage(lastmessage)) { return(Ok()); } return(InternalServerError()); }