private async Task <ReferenceDataViewModel> RefreshModelData(string collectionName, CancellationToken cancellationToken) { var collection = _collectionsService.GetReferenceDataCollection(collectionName); var model = await _referenceDataProcessService.GetProcessOutputsForCollectionAsync( Utils.Constants.ReferenceDataStorageContainerName, collection.CollectionName, collection.ReportName, FileNameExtensionConsts.CSV, collection.FileNameFormat, collection.FileFormat, cancellationToken : cancellationToken); model.CollectionDisplayName = collection.DisplayName; model.HubName = collection.HubName; model.FileExtension = collection.FileFormat; return(model); }
public async Task SendMessage(CancellationToken cancellationToken) { if (!ReferenceDataHubUserHandler.AnyConnectionIds(ReferenceDataTypes.FisReferenceData2021)) { return; } var stateModel = await _referenceDataService.GetProcessOutputsForCollectionAsync( Constants.ReferenceDataStorageContainerName, CollectionNames.DevolvedPostcodesPublication, ReportTypes.DevolvedPostcodesPublicationSummaryReportName, FileNameExtensionConsts.CSV, ReferenceDataOutputTypes.DevolvedPostcodesPublicationZipPreFix, FileNameExtensionConsts.ZIP, cancellationToken : cancellationToken); var state = _serialisationHelperService.SerialiseToCamelCase(stateModel); await _hubContext.Clients.All.SendAsync("ReceiveMessage", state, cancellationToken); }