Пример #1
0
        public HmmNote GetNoteById(int id, bool includeDeleted = false)
        {
            var note = _noteRepo.GetEntity(id);

            if (includeDeleted)
            {
                return(note);
            }

            if (note != null)
            {
                return(note.IsDeleted ? null : note);
            }

            return(null);
        }
Пример #2
0
        private bool AuthorNotChanged(HmmNote note, Author author)
        {
            if (author == null)
            {
                return(false);
            }

            var savedNote = _dataRepo.GetEntity(note.Id);

            // create new user, make sure account name is unique
            var authorId = author.Id;

            if (savedNote == null)
            {
                return(true);
            }

            return(savedNote.Author.Id == authorId);
        }