public static ChatNote CreateNote(ChatNote note) { using (var context = new BackofficeUnitOfWork()) { note.CreateDate = note.LastUpdateDate = DateTime.Now; context.ChatNote.Create(note); context.Save(); return(note); } }
public static bool DeleteNote(long noteId, string ID_User) { using (var context = new BackofficeUnitOfWork()) { ChatNote note = context.ChatNote.Fetch().FirstOrDefault(i => i.ID == noteId && i.ID_User == ID_User); if (null == note) { return(false); } context.ChatNote.Delete(note.ID); context.Save(); return(true); } }