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

            string RequestUri = string.Format("bulk/{0}/json", ResourceName);

            Dictionary <string, string> dicQueryStringParameters = new Dictionary <string, string>();

            dicQueryStringParameters.Add("overwrite", OverwriteMethod.ToString());

            string postBody    = PepperiJsonSerializer.Serialize(FlatModel);                      //null values are not serialzied.
            string contentType = "application/json";
            string accept      = "application/json";

            PepperiHttpClient         PepperiHttpClient         = new PepperiHttpClient(this.Authentication, this.Logger);
            PepperiHttpClientResponse PepperiHttpClientResponse = PepperiHttpClient.PostStringContent(
                ApiBaseUri,
                RequestUri,
                dicQueryStringParameters,
                postBody,
                contentType,
                accept
                );

            PepperiHttpClient.HandleError(PepperiHttpClientResponse);

            BulkUploadResponse result = PepperiJsonSerializer.DeserializeOne <BulkUploadResponse>(PepperiHttpClientResponse.Body);

            return(result);
        }
        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);
        }