/// <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);
        }
        /// <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);
        }
        /// <summary>
        /// CRUD - Delete Car Data Methode
        /// </summary>
        /// <param name="car"></param>
        /// <returns></returns>
        public int DeleteCar(CarsModel car)
        {
            var    db    = new SqliteDbAccess();
            string query = "DELETE FROM CarsModel WHERE Id = @id";

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

            dictionary.Add("@id", car.Id);

            int hasil = db.Execution(query, dictionary);

            db.Dispose();

            return(hasil);
        }
        /// <summary>
        /// CRUD - Update Car Data Methode
        /// </summary>
        /// <param name="car"></param>
        /// <returns></returns>
        public int UpdateCar(CarsModel car)
        {
            var    db    = new SqliteDbAccess();
            string query = "UPDATE CarsModel SET ModelName = @modelName, SeriesName = @seriesName," +
                           "  ModelYear = @modelYear, NumberCar = @numberCar, CreateDate = @createDate, RentCost = @rentCost WHERE Id = @id";

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

            dictionary.Add("@modelName", car.ModelName);
            dictionary.Add("@seriesName", car.SeriesName);
            dictionary.Add("@modelYear", car.ModelYear);
            dictionary.Add("@numberCar", car.NumberCar);
            dictionary.Add("@createDate", car.CreateDate);
            dictionary.Add("@id", car.Id);
            dictionary.Add("@rentCost", car.RentCost);

            int hasil = db.Execution(query, dictionary);

            db.Dispose();

            return(hasil);
        }
        /// <summary>
        /// CRUD - Insert Car Data Methode
        /// </summary>
        /// <param name="car"></param>
        /// <returns></returns>
        public int InsertCar(CarsModel car)
        {
            var    db    = new SqliteDbAccess();
            string query = "INSERT INTO CarsModel " +
                           "(ModelName, SeriesName, ModelYear, NumberCar, CreateDate, RentCost) " +
                           "values " +
                           "(@modelName, @seriesName, @modelYear, @numberCar, @createDate, @rentCost)";

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

            dictionary.Add("@modelName", car.ModelName);
            dictionary.Add("@seriesName", car.SeriesName);
            dictionary.Add("@modelYear", car.ModelYear);
            dictionary.Add("@numberCar", car.NumberCar);
            dictionary.Add("@createDate", car.CreateDate);
            dictionary.Add("@rentCost", car.RentCost);

            int hasil = db.Execution(query, dictionary);

            db.Dispose();

            return(hasil);
        }