示例#1
0
        /// <summary>
        /// Initializes a new instance of the DependencyModule class.
        /// </summary>
        /// <param name="dependency"></param>
        public DependencyModule(IApplicationDependency applicationDependency, IRequestDependency requestDependency)
        {
            _ApplicationDependency = applicationDependency;
            _RequestDependency = requestDependency;

            Get["/dependency"] = x =>
            {
                var model = new RatPackWithDependencyText()
                    {
                        FirstName = "Bob",
                        ApplicationDependencyText = _ApplicationDependency.GetContent(),
                        RequestDependencyText = _RequestDependency.GetContent()
                    };

                return View.Razor("~/views/razor-dependency.cshtml", model);
            };
        }
示例#2
0
        /// <summary>
        /// Initializes a new instance of the DependencyModule class.
        /// </summary>
        /// <param name="dependency"></param>
        public DependencyModule(IApplicationDependency applicationDependency, IRequestDependency requestDependency)
        {
            _ApplicationDependency = applicationDependency;
            _RequestDependency     = requestDependency;

            Get["/dependency"] = x =>
            {
                var model = new RatPackWithDependencyText()
                {
                    FirstName = "Bob",
                    ApplicationDependencyText = _ApplicationDependency.GetContent(),
                    RequestDependencyText     = _RequestDependency.GetContent()
                };
                //Compiles but does not execute as expected under Mono 2.8
//                return View.Razor("~/views/razor-dependency.cshtml", model);
                //Switching to Spark for demo
                return(View.Spark("~/views/spark-dependency.spark", model));
            };
        }
示例#3
0
        /// <summary>
        /// Initializes a new instance of the DependencyModule class.
        /// </summary>
        /// <param name="dependency"></param>
        public DependencyModule(IApplicationDependency applicationDependency, IRequestDependency requestDependency)
        {
            _ApplicationDependency = applicationDependency;
            _RequestDependency = requestDependency;

            Get["/dependency"] = x =>
            {
                var model = new RatPackWithDependencyText()
                    {
                        FirstName = "Bob",
                        ApplicationDependencyText = _ApplicationDependency.GetContent(),
                        RequestDependencyText = _RequestDependency.GetContent()
                    };
                //Compiles but does not execute as expected under Mono 2.8
            //                return View.Razor("~/views/razor-dependency.cshtml", model);
                //Switching to Spark for demo
                return View.Spark("~/views/spark-dependency.spark", model);
            };
        }