public int SaveItem(Message item, int i) { if (messagesList.Find(x => x.contentP == item.contentP && x.timeP == item.timeP) == null) { return(connection.Insert(item)); } else { return /*connection.Update(item)*/ (0); } }
public int SaveItem(Message item) { messagesList = connection.Table <Message>().ToList(); if (item.Id != 0) { connection.Update(item); return(item.Id); } else { if (messagesList.Find(x => x.dialogName == item.dialogName && x.contentP == item.contentP && x.timeP == item.timeP) == null) { return(connection.Insert(item)); } else { return(0); } } }
public Message FindItemI(Message item) { messagesList = connection.Table <Message>().ToList(); return(messagesList.Find(x => x.contentP == item.contentP && x.timeP == item.timeP)); }
public int SaveItem(Message item, bool t) { return(connection.Insert(item)); }