Ejemplo n.º 1
0
        /// <summary>
        /// Get page provider.
        /// </summary>
        /// <param name="module"></param>
        /// <param name="host"></param>
        /// <returns></returns>
        public static IPageProvider?GetPageProvider(this IRazorComponentClientModule module, IModuleHost host)
        {
            var collection = host.GetRazorComponentClientModuleCollection();
            var manifest   = collection.GetManifest(module.GetType());

            if (manifest.PageProvider is not null)
            {
                return((IPageProvider)host.Services.GetRequiredService(manifest.PageProvider));
            }
            return(null);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Create the instance.
 /// </summary>
 /// <param name="host"></param>
 protected RazorComponentClientModule(IModuleHost host) : base(host)
 {
     Collection = host.GetRazorComponentClientModuleCollection();
     _manifest  = new Lazy <RazorComponentClientModuleManifest>(() => Collection.GetManifest(GetType()));
 }