public void AddNote(Note note, string userId)
        {
            this.validationProvider.Validate(note);

            Video video = this.videoRepository.Table.Where(
                x => (x.VideoId == note.VideoId) &&
                    (x.Category.ApplicationUserId == userId)).FirstOrDefault();

            if (video != null)
            {
                this.noteRepository.Insert(note);
                return;
            }

            throw new ValidationException(
                new List<ValidationResult>()
                {
                    new ValidationResult(
                        "user",
                        ValidationExceptionMessages.UserNotAuthenticated(
                        userId,
                        "add note",
                        note.VideoId.ToString()))
                });
        }
 public void DeleteNote(Note note)
 {
     this.noteRepository.Delete(note);
 }
        public ActionResult AddNote(NoteViewModel note)
        {
            int videoId = note.VideoId;
            decimal time = note.Time;
            string userId = User.Identity.GetUserId();
            Note n = new Note
            {
                //Color = note.Color,
                Content = note.Content,
                Share = note.Share,
                Time = time,
                Title = note.Title,
                VideoId = videoId
            };
            try
            {
                this.noteService.AddNote(n, userId);
            }
            catch (ValidationException ex)
            {
                ExceptionBindingInMS.AddModelErrors(this.ModelState, ex);
                return PartialView("_Notes");
            }

            return this.GetNotes(note.VideoId);
        }