private async Task <Tuple <IList <Merchant>, IList <Merchant> > > ProcessMerchantFileAsync(MemoryStream memoryStream)
        {
            IList <Merchant> lstImportedMerchants = null;

            Log.Info($"Importing data from {merchantFileType.ToString()}");
            MerchantFileProcessor merchantFileProcessor = MerchantProcessorFactory.GetMerchantFileProcessor(merchantFileName);

            if (merchantFileType == MerchantFileType.MasterCardAuth)
            {
                lstImportedMerchants = await Task.Run(() => merchantFileProcessor.ImportMasterCardAuthFile(memoryStream)).ConfigureAwait(false);
            }
            else if (merchantFileType == MerchantFileType.MasterCardClearing)
            {
                lstImportedMerchants = await Task.Run(() => merchantFileProcessor.ImportMasterCardClearingFile(memoryStream)).ConfigureAwait(false);
            }
            if (lstImportedMerchants == null || !lstImportedMerchants.Any())
            {
                throw new Exception($"Error in processing the {merchantFileType.ToString()} file.");
            }
            Log.Info($"Total unique records imported from {merchantFileType.ToString()} is {lstImportedMerchants.Count}");

            Log.Info($"Getting all merchants for provider {provider.Id} from db");
            merchantsInDb = await EarnRepository.Instance.GetMerchantsForProviderAsync(provider.Id).ConfigureAwait(false);

            Log.Info($"Got {merchantsInDb.Count()} merchant entries for provider {provider.Id} from db");

            Tuple <IList <Merchant>, IList <Merchant> > lstMerchants = await Task.Run(() => AddOrUpdateMerchant(lstImportedMerchants)).ConfigureAwait(false);

            return(lstMerchants);
        }