public ActionResult Edit(Note note)
        {
            var noteData = NoteMapper.Map(note);
            noteRepository.Update(noteData);

            return RedirectToRoute("NoteList");
        }
        public void Add(object o)
        {
            var userRepo = new UserRepository();
            Note note = new Note();
            var str = o.ToString();
            JObject obj = JObject.Parse(str);

            var userId = (int)obj.SelectToken("UserId");

            note.Author = UserMapper.Map(userRepo.Get(userId));
            note.Text = (string)obj.SelectToken("Text");
            note.Title = (string)obj.SelectToken("Title");
            
            //note.CreatedOn = DateTime.Now;

            noteRepository.Create(NoteMapper.Map(note));
        }
 public void Edit(Note note)
 {
     var noteData = NoteMapper.Map(note);
     _noteRepository.Update(noteData);
 }
 public void Create(Note note)
 {
     var noteData = NoteMapper.Map(note);
     _noteRepository.Create(noteData);
 }