public FuelRecordRepository(string connection)
 {
     _context = new FuelTrackerContext(connection);
     if (!_context.DatabaseExists())
     {
         _context.CreateDatabase();
     }
 }
 public FuelRecordsListViewModel(FuelTrackerContext 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();
     }
 }
        public CarCreateOrEditViewModel(FuelTrackerContext 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.Car = new Car();
        }
        private FuelRecordDetailsViewModel(FuelTrackerContext 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.FuelRecord = new FuelRecord();
        }