Exemple #1
0
        public List <Models.Note> Get()
        {
            NotesDBContext db        = new NotesDBContext();
            var            NotesList = db.Notes.ToList();

            return(NotesList);
        }
Exemple #2
0
        public Boolean DeleteNote(int id)
        {
            NotesDBContext db   = new NotesDBContext();
            Note           note = db.Notes.Find(id);

            db.Notes.Remove(note);
            db.SaveChanges();
            return(true);
        }
Exemple #3
0
        public Boolean AddNote(string title, string desc)
        {
            NotesDBContext db = new NotesDBContext();

            Models.Note note = new Note();
            note.Title = title;
            note.Desc  = desc;

            db.Notes.Add(note);
            db.SaveChanges();
            return(true);
        }
Exemple #4
0
 public NoteRepository(NotesDBContext context)
 {
     _context = context;
 }
 public NotesController(NotesDBContext context)
 {
     this.context = context;
 }
Exemple #6
0
 public NotesService(NotesDBContext context)
 {
     _context = context;
 }
Exemple #7
0
 public NotesRepository(NotesDBContext context)
 {
     this._context = context;
 }