private IClassProvider TryGetTemplateInstance(ITypeReference typeInfo)
        {
            if (typeInfo.Element == null)
            {
                return(null);
            }
            var templateInstance = _context.FindTemplateInstance <IClassProvider>(TemplateDependency.OnModel(_templateId, typeInfo.Element));


            return(templateInstance);
        }
 public static TTemplate FindTemplateInstance <TTemplate>(this ISoftwareFactoryExecutionContext executionContext, ITemplateDependency templateDependency) where TTemplate : class
 {
     return((TTemplate)executionContext.FindTemplateInstance(templateDependency.TemplateId, templateDependency.IsMatch));
 }
 public static TTemplate FindTemplateInstance <TTemplate>(this ISoftwareFactoryExecutionContext executionContext, string templateId) where TTemplate : class
 {
     return((TTemplate)executionContext.FindTemplateInstance(TemplateDependency.OnTemplate(templateId)) as TTemplate);
 }
 public static TTemplate FindTemplateInstance <TTemplate>(this ISoftwareFactoryExecutionContext executionContext, string templateId, object model) where TTemplate : class
 {
     return((TTemplate)executionContext.FindTemplateInstance(templateId, model) as TTemplate);
 }
        //public static ITemplate FindTemplateInstance(this IApplication executionContext, string templateId, string className)
        //{
        //    return executionContext.FindTemplateInstance(templateId, TemplateDependency.OnClassName(templateId, className));
        //}

        public static ITemplate FindTemplateInstance(this ISoftwareFactoryExecutionContext executionContext, ITemplateDependency templateDependency)
        {
            return(executionContext.FindTemplateInstance(templateDependency.TemplateId, templateDependency.IsMatch));
        }