Пример #1
0
        /// <summary>
        /// Query Get All Cars Data
        /// </summary>
        /// <returns></returns>
        public IEnumerable <CarsModel> GetAllCars()
        {
            var    db    = new SqliteDbAccess();
            string query = "SELECT * FROM CarsModel ";

            IEnumerable <CarsModel> hasil = db.Get <CarsModel>(query, null);

            db.Dispose();

            return(hasil);
        }
Пример #2
0
        /// <summary>
        /// Query Get Car data with filter id
        /// </summary>
        /// <param name="car"></param>
        /// <returns></returns>
        public IEnumerable <CarsModel> GetAllCarsFilter(CarsModel car)
        {
            var    db    = new SqliteDbAccess();
            string query = "SELECT * FROM CarsModel where Id = @id";

            Dictionary <string, object> dictionary = new Dictionary <string, object>();

            dictionary.Add("@id", car.Id);
            IEnumerable <CarsModel> hasil = db.Get <CarsModel>(query, dictionary);

            db.Dispose();

            return(hasil);
        }