Ejemplo n.º 1
0
        public virtual IDictionary <string, string> GetModels(
            string dtmi, ModelDependencyResolution?dependencyResolution = null, CancellationToken cancellationToken = default)
        {
            using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(ModelsRepositoryClient)}.{nameof(GetModels)}");
            scope.Start();

            try
            {
                return(_repositoryHandler.Process(dtmi, dependencyResolution ?? _clientOptions.DependencyResolution, cancellationToken));
            }
            catch (Exception ex)
            {
                scope.Failed(ex);
                throw;
            }
        }
Ejemplo n.º 2
0
        public virtual ModelResult GetModel(
            string dtmi, ModelDependencyResolution dependencyResolution = ModelDependencyResolution.Enabled, CancellationToken cancellationToken = default)
        {
            using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(ModelsRepositoryClient)}.{nameof(GetModel)}");
            scope.Start();

            try
            {
                return(_repositoryHandler.Process(dtmi, dependencyResolution, cancellationToken));
            }
            catch (Exception ex)
            {
                scope.Failed(ex);
                throw;
            }
        }