示例#1
0
        public Component FindComponent(HtmlNode node, HttpContext context)
        {
            var component = _types.Single(x => x.Name.ToLower() == $"{node.Name.ToLower()}component");

            var instance = _provider.CreateComponent(component, node, context);

            return(instance);
        }
示例#2
0
        public Component FindComponent(HtmlNode node)
        {
            var component = _types.Single(x => x.Name.ToLower() == $"{node.Name.ToLower()}component");

            var instance = (Component)_provider.GetRequiredService(component);

            instance.HtmlElement = node;

            return(instance);
        }