Skip to content

Commit

Permalink
使用Microsoft.AspCore.Razor对视图引擎进行重构.
Browse files Browse the repository at this point in the history
  • Loading branch information
zhanglei13 authored and zhanglei13 committed May 20, 2016
1 parent 83d146f commit 1c4fb55
Show file tree
Hide file tree
Showing 5 changed files with 71 additions and 40 deletions.
6 changes: 5 additions & 1 deletion Notepad/ASP.NET Core 总结1.md
Expand Up @@ -17,4 +17,8 @@


#### 总结:
>新的项目文件 project.json 主要用于统一管理dotnet的发布、编译、平台、程序集依赖等。
>新的项目文件 project.json 主要用于统一管理dotnet的发布、编译、平台、程序集依赖等。


MySQL CORE :https://coding.net/u/zlzforever/p/share/git/tree/master
24 changes: 4 additions & 20 deletions YOYO.AspNetCore.Mvc/project.json
@@ -1,17 +1,17 @@
{
"version": "1.0.0-*",
"version": "0.1.3-*",

"dependencies": {
"Newtonsoft.Json": "8.0.3",
"YOYO.AspNetCore.Owin": "0.1.3-*"
"YOYO.AspNetCore.Owin": { "target": "project" , "type": "build"}
},

"buildOptions": {
"compile": [
"*.cs",
"../YOYO.Mvc/**.cs"
]

},

"frameworks": {
Expand All @@ -24,23 +24,7 @@
"System.Xml.Serialization": "4.0.0.0"
}
},
//"netcoreapp1.0": {
// "dependencies": {
// "System.Collections": "4.0.11-rc2-24027",
// "System.Linq": "4.1.0-rc2-24027",
// "System.Runtime": "4.1.0-rc2-24027",
// "System.Reflection": "4.1.0-rc2-24027",
// "System.Xml.XmlSerializer": "4.0.11-rc2-24027",
// "Microsoft.Extensions.PlatformAbstractions": "1.0.0-rc2-final",
// "Microsoft.NETCore.App": "1.0.0-*",

// "System.Runtime.Loader": "4.0.0-rc2-24027"
// },
// "imports": [
// "portable-net45+wp80+win8+wpa81+dnxcore50",
// "portable-net451+win8"
// ]
//}

"netstandard1.5": {
"dependencies": {
"NETStandard.Library": "1.5.0-*",
Expand Down
16 changes: 0 additions & 16 deletions YOYO.AspNetCore.ViewEngine.Razor/Class1.cs

This file was deleted.

48 changes: 48 additions & 0 deletions YOYO.AspNetCore.ViewEngine.Razor/RazorViewEngine.cs
@@ -0,0 +1,48 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Razor;
using YOYO.Mvc;

namespace YOYO.AspNetCore.ViewEngine.Razor
{
// This project can output the Class library as a NuGet Package.
// To enable this option, right-click on the project and select the Properties menu item. In the Build tab select "Produce outputs on build".
public class RazorViewEngine : IViewEngine
{
public RazorViewEngine()
{


var host = new RazorEngineHost(new CSharpRazorCodeLanguage());

// Act
var engine = new RazorTemplateEngine(host);



}


~RazorViewEngine()
{
//.Dispose();
}

public string ExtensionName
{
get
{
return ".cshtml";
}
}

public string RenderView(YOYO.Owin.IOwinContext context, string viewName, object model, DynamicDictionary viewbag)
{


throw new NotImplementedException();
}
}
}
17 changes: 14 additions & 3 deletions YOYO.AspNetCore.ViewEngine.Razor/project.json
@@ -1,8 +1,19 @@
{
"version": "1.0.0-*",
{
"description": "",

"version": "0.1.3-*",

"dependencies": {
"NETStandard.Library": "1.5.0-rc2-24027"
"Microsoft.AspNetCore.Razor": "1.0.0-*",
"NETStandard.Library": "1.5.0-*",
"YOYO.AspNetCore.Mvc": {
"target": "project",
"type": "build"
},
"YOYO.AspNetCore.Owin": {
"target": "project",
"type": "build"
}
},

"frameworks": {
Expand Down

0 comments on commit 1c4fb55

Please sign in to comment.