public static List <NotesModel> EditNote(int id, NotesModel Note, int Userid)
 {
     using (var dbContext = new FiszkiContext())
     {
         var editedNote = dbContext.NotesTable.FirstOrDefault(x => x.id == id && x.userId == Userid);
         {
             editedNote.type        = Note.type;
             editedNote.title       = Note.title;
             editedNote.articleUrl  = Note.articleUrl;
             editedNote.noteContent = Note.noteContent;
             editedNote.dateUser    = Note.dateUser;
             editedNote.lastEdit    = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
             editedNote.rating      = Note.rating;
             editedNote.isActive    = 1;
         };
         dbContext.SaveChanges();
         var EditetItem = dbContext.NotesTable.Where(item => item.id == id).ToList();
         return(EditetItem);
     }
 }
        public static List <NotesModel> AddNote(NotesModel NewNote, int Userid)
        {
            using (var dbContext = new FiszkiContext())
            {
                var newNote = new NotesModel
                {
                    userId      = Userid,
                    type        = NewNote.type,
                    title       = NewNote.title,
                    articleUrl  = NewNote.articleUrl,
                    noteContent = NewNote.noteContent,
                    dateUser    = NewNote.dateUser,
                    created     = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
                    lastEdit    = null,
                    rating      = NewNote.rating,
                    isActive    = 1,
                };
                dbContext.NotesTable.Add(newNote);
                dbContext.SaveChanges();

                int id = newNote.id;
                return(dbContext.NotesTable.Where(item => item.id == id).ToList());
            }
        }