Exemplo n.º 1
0
        public MvcRazorHost(string baseType)
            : base(new CSharpRazorCodeLanguage())
        {
            // TODO: this needs to flow from the application rather than being initialized here.
            // Tracked by #774
            _hostOptions          = new MvcRazorHostOptions();
            _baseType             = baseType;
            DefaultBaseClass      = baseType + '<' + _hostOptions.DefaultModel + '>';
            GeneratedClassContext = new GeneratedClassContext(
                executeMethodName: "ExecuteAsync",
                writeMethodName: "Write",
                writeLiteralMethodName: "WriteLiteral",
                writeToMethodName: "WriteTo",
                writeLiteralToMethodName: "WriteLiteralTo",
                templateTypeName: "HelperResult",
                defineSectionMethodName: "DefineSection")
            {
                ResolveUrlMethodName = "Href"
            };

            foreach (var ns in _defaultNamespaces)
            {
                NamespaceImports.Add(ns);
            }
        }
Exemplo n.º 2
0
        public MvcRazorHost(string baseType)
            : base(new CSharpRazorCodeLanguage())
        {
            // TODO: this needs to flow from the application rather than being initialized here.
            // Tracked by #774
            _hostOptions = new MvcRazorHostOptions();
            _baseType = baseType;
            DefaultBaseClass = baseType + '<' + _hostOptions.DefaultModel + '>';
            GeneratedClassContext = new GeneratedClassContext(
                executeMethodName: "ExecuteAsync",
                writeMethodName: "Write",
                writeLiteralMethodName: "WriteLiteral",
                writeToMethodName: "WriteTo",
                writeLiteralToMethodName: "WriteLiteralTo",
                templateTypeName: "HelperResult",
                defineSectionMethodName: "DefineSection")
            {
                ResolveUrlMethodName = "Href"
            };

            foreach (var ns in _defaultNamespaces)
            {
                NamespaceImports.Add(ns);
            }
        }
Exemplo n.º 3
0
 public MvcCSharpCodeBuilder([NotNull] CodeGeneratorContext context,
                             [NotNull] MvcRazorHostOptions hostOptions)
     : base(context)
 {
     _hostOptions = hostOptions;
 }
Exemplo n.º 4
0
 public MvcCSharpCodeBuilder([NotNull] CodeGeneratorContext context, 
                             [NotNull] MvcRazorHostOptions hostOptions)
     : base(context)
 {
     _hostOptions = hostOptions;
 }