2.1.0更新的内容有html
Linux:
从Github的Release页面下载并解压缩 'ProjectCreator.Gui-linux-x64.zip'到'ZKWeb/Tools', 而后打开'ProjectCreator.Gui'.mysql
Windows:
从Github的Release页面下载并解压缩 'ProjectCreator.Gui-win32-x64.rar'到'ZKWeb/Tools', 而后打开'ProjectCreator.Gui.exe'.linux
记录原始SQL语句或命令git
从ZKWeb 2.1开始, 你能够经过提供IDatabaseCommandLogger
来记录原始的SQL语句或命令.
添加[ExportMany]
属性注册到容器会全局记录, 例如:github
[ExportMany] public class Mylogger : IDatabaseCommandLogger { public void LogCommand(IDatabaseContext context, string command, object metadata) { Console.WriteLine(command); } }
若是只想记录某个上下文的语句, 则不要添加[ExportMany]
而是设置Context.CommandLogger = new Mylogger()
.
目前支持记录SQL语句或命令的ORM有:web
从ZKWeb 2.1开始, 经过在控制器类上标记[ActionBase]
属性, 或者在方法上标记[Action]
属性能够控制访问路径.
例如:sql
[ExportMany] public class ExampleController : IController { // 不标记[ActionBase]也不标记[Action] // 访问路径是 "/Example/PlainText" public IActionResult PlainText() { return new PlainResult("some plain text"); } }
[ExportMany] [ActionBase("/MyExample")] public class ExampleController : IController { // 标记[ActionBase]但不标记[Action] // 访问路径是 "/MyExample/PlainText" public IActionResult PlainText() { return new PlainResult("some plain text"); } }
[ExportMany] [ActionBase("/MyExample")] public class ExampleController : IController { // 同时标记[ActionBase]和[Action] // 访问路径是 "/MyExample/MyPlainText" [Action("MyPlainText")] public IActionResult PlainText() { return new PlainResult("some plain text"); } }
[ExportMany] public class ExampleController : IController { // 不标记[ActionBase], 只标记[Action] (兼容2.0以前的版本) // [Action]标记的就是完整路径 // 访问路径是 "/MyPlainText" [Action("/MyPlainText")] public IActionResult PlainText() { return new PlainResult("some plain text"); } }
由于NHibernate 5.1支持.Net Core, 基于NH编写的商城系统(http://demo.zkweb.org)已经能够在Linux上运行, 99%的功能均可用.
若是你使用ZKWeb框架建立新的项目,强烈推荐使用NHibernate而不是EFCore, 由于NHibernate的功能和.Net Framework上的同样完整.数据库
下个版本预计会作的事情json