private void cleanUserByChatMessages(UsersByChat userByChat) { foreach (Messages message in this.getServiceCore().Container.GetInstance <MessagesServices>().getMessagesFromChat(userByChat)) { this.getServiceCore().Container.GetInstance <MessagesServices>().Delete(new Messages() { ID = message.ID }); } }
public IEnumerable <Messages> getMessagesFromChat(UsersByChat chat) { var cn = this._context.Database.Connection; var sql = @"SELECT ID, UsersByChatID, Message, Type, InsertedDate FROM Messages WHERE UsersByChatID = " + chat.ID; return(cn.Query <Messages>(sql)); }
private void userInteraction(UsersByChat userByChat) { userByChat.LastInteraction = DateTime.Now; userByChat.Connected = true; ServiceCore.getInstance().Container.GetInstance <UsersByChatServices>().Update(userByChat); }
public IEnumerable <Messages> getMessagesFromChat(UsersByChat chat) { return(this._repository.getMessagesFromChat(chat)); }