Exemple #1
0
 public IActionResult Display(
     string name,
     [FromServices] IApiDocumentProvider api)
 {
     api.GetDocument(name, out string title, out string spec);
     ViewBag.Title = title;
     ViewBag.Spec  = spec;
     return(View("/Areas/Dashboard/Views/ApiDoc/Display.cshtml"));
 }
Exemple #2
0
        /// <summary>
        /// add assembly with document provider
        /// </summary>
        /// <param name="assembly"></param>
        /// <param name="documentProvider"></param>
        public void AddAssembly(Assembly assembly, IApiDocumentProvider documentProvider)
        {
            var existingKey = AssemblyDocumentProviderMapping.Keys.Where(c => c.FullName.Equals(assembly.FullName)).FirstOrDefault();

            if (existingKey != null)
            {
                AssemblyDocumentProviderMapping[existingKey] = documentProvider;
            }
            else
            {
                AssemblyDocumentProviderMapping[assembly] = documentProvider;
            }
        }