public NoteDetailsViewModel(MyNotesContext context, System.Int32 id)
     : this(context)
 {
     if (id <= 0)
     {
         throw new ArgumentException("id must be greater than 0!");
     }
     this.Load(id);
 }
 public NotesListViewModel(MyNotesContext context)
 {
     if (context == null)
     {
         throw new ArgumentNullException("repository must not be null");
     }
     this._context = context;
     //create database if not exists
     if (!_context.DatabaseExists())
     {
         _context.CreateDatabase();
     }
 }
        private NoteDetailsViewModel(MyNotesContext context)
        {
            if (context == null)
            {
                throw new ArgumentNullException("context must not be null");
            }

            this._context = context;
            //create database if not exists
            if (!_context.DatabaseExists())
            {
                _context.CreateDatabase();
            }

            this.Note = new Note();
        }
        public NoteCreateOrEditViewModel(MyNotesContext context, System.Int32 id)
            : this(context)
        {
            if (id < 0)
            {
                throw new ArgumentException("id must be greater than 0!");
            }

            if (id == 0)
            {
                this.CreateNew();
            }
            else
            {
                this.Load(id);
            }
        }