private BulkUploadResponse BulkUploadOfZip(IEnumerable <TModel> data, eOverwriteMethod OverwriteMethod, IEnumerable <string> fieldsToUpload, string FilePathToStoreZipFile, string SubTypeID = null)
        {
            FlatModel FlatModel = PepperiFlatSerializer.MapDataToFlatModel(data, fieldsToUpload, "''");

            string CsvFileAsString = PepperiFlatSerializer.FlatModelToCsv(FlatModel);

            byte[] CsvFileAsZipInUTF8 = PepperiFlatSerializer.UTF8StringToZip(CsvFileAsString, FilePathToStoreZipFile);

            BulkUploadResponse result = BulkUploadOfZip(CsvFileAsZipInUTF8, OverwriteMethod, SubTypeID);

            return(result);
        }
        public BulkUploadResponse BulkUpload(string csvFilePath, eOverwriteMethod OverwriteMethod, Encoding fileEncoding, string SubTypeID = "", string FilePathToStoreZipFile = null)
        {
            byte[] fileAsBinary = File.ReadAllBytes(csvFilePath);
            bool   isToAddBOM   = true;

            // UTF8 byte order mark is: 0xEF,0xBB,0xBF
            if (fileAsBinary[0] == 0xEF && fileAsBinary[1] == 0xBB && fileAsBinary[2] == 0xBF)
            {
                isToAddBOM = false;
            }
            byte[] fileAsUtf8       = Encoding.Convert(fileEncoding, Encoding.UTF8, fileAsBinary);
            string fileAsUtf8String = System.Text.Encoding.UTF8.GetString(fileAsUtf8);

            byte[] fileAsZipInUTF8 = PepperiFlatSerializer.UTF8StringToZip(fileAsUtf8String, FilePathToStoreZipFile, isToAddBOM);

            BulkUploadResponse result = BulkUploadOfZip(fileAsZipInUTF8, OverwriteMethod, SubTypeID);

            return(result);
        }