Example #1
0
        public async Task SaveModelAsync(IModel model, CancellationToken cancellationToken)
        {
            Func <Stream, Task> saveModel = stream =>
            {
                model.Context.Model.Save(model.Model, model.Schema, stream);
                return(Task.CompletedTask);
            };

            await _persistenceProvider.SetBlobContentAsync(_options.Value.ConnectionString, _options.Value.FaceRecognitionModelContainerName, "Model.zip", saveModel, cancellationToken);
        }
Example #2
0
        public async Task SetStateSnapshotAsync(Snapshot snapshot, CancellationToken cancellationToken)
        {
            Func <Stream, Task> serialization = stream => JsonSerializer.SerializeAsync(stream, snapshot);

            await _persistenceProvider.SetBlobContentAsync(_options.Value.ConnectionString, _options.Value.SnapshotContainer, "Snapshot.json", serialization, cancellationToken);
        }