Comments (14)
终于彻底删掉了 Mvc 2.2 这个包袱, 轻松升级到 .net 5.0 https://github.com/beginor/SmartCode 。
顺便把 Handlebars 模板引擎实现也删掉了, 这个似乎没有人用。 目前只有配置文件中还用到一点。
很多时候就得做减法。
from smartcode.
同问, 现在 smartcode 使用的是 .netcore 2.2 , 这个版本不是 lts 版本, 已经过了支持期, 建议升级到 .netcore 3.1 。
from smartcode.
支持
from smartcode.
初略的看了一下代码, 可能是因为引用了 Host 来初始化 Razor 引擎, 导致升级到 3.x 比较困难。 可以考虑这中实现方式 https://github.com/adoconnection/RazorEngineCore 或者直接引用这个类库来替换现有的 Razor 实现 @Ahoo-Wang
from smartcode.
这里还有一篇 RazorEngineCore 的介绍 https://www.codeproject.com/Articles/5260233/Building-String-Razor-Template-Engine-with-Bare-Ha
from smartcode.
初略的看了一下代码, 可能是因为引用了 Host 来初始化 Razor 引擎, 导致升级到 3.x 比较困难。 可以考虑这中实现方式 https://github.com/adoconnection/RazorEngineCore 或者直接引用这个类库来替换现有的 Razor 实现 @Ahoo-Wang
将项目'SmartCode.CLI'的目标框架由netcoreapp2.2 改成netcoreapp3.1不就行了
from smartcode.
初略的看了一下代码, 可能是因为引用了 Host 来初始化 Razor 引擎, 导致升级到 3.x 比较困难。 可以考虑这中实现方式 https://github.com/adoconnection/RazorEngineCore 或者直接引用这个类库来替换现有的 Razor 实现 @Ahoo-Wang
将项目'SmartCode.CLI'的目标框架由netcoreapp2.2 改成netcoreapp3.1不就行了
不是那么简单的, 2.x 到 3.x 的升级比较复杂, 尤其是 host 这部分。 不仅很多包都没有了, 而且用法也发生了很大的变化。
from smartcode.
初略的看了一下代码, 可能是因为引用了 Host 来初始化 Razor 引擎, 导致升级到 3.x 比较困难。 可以考虑这中实现方式 https://github.com/adoconnection/RazorEngineCore 或者直接引用这个类库来替换现有的 Razor 实现 @Ahoo-Wang
将项目'SmartCode.CLI'的目标框架由netcoreapp2.2 改成netcoreapp3.1不就行了不是那么简单的, 2.x 到 3.x 的升级比较复杂, 尤其是 host 这部分。 不仅很多包都没有了, 而且用法也发生了很大的变化。
呃,貌似真没那么复杂,我就是这样做的,然后打了个包放到了私有库,不一样的正常使用嘛
from smartcode.
初略的看了一下代码, 可能是因为引用了 Host 来初始化 Razor 引擎, 导致升级到 3.x 比较困难。 可以考虑这中实现方式 https://github.com/adoconnection/RazorEngineCore 或者直接引用这个类库来替换现有的 Razor 实现 @Ahoo-Wang
将项目'SmartCode.CLI'的目标框架由netcoreapp2.2 改成netcoreapp3.1不就行了不是那么简单的, 2.x 到 3.x 的升级比较复杂, 尤其是 host 这部分。 不仅很多包都没有了, 而且用法也发生了很大的变化。
呃,貌似真没那么复杂,我就是这样做的,然后打了个包放到了私有库,不一样的正常使用嘛
这个真不一样, 得用 3.x 的 host 才算是真正的升级到了 3.x , 只改 BuildTarget 是不能算升级, 会被 @Ahoo-Wang 鄙视的
from smartcode.
初略的看了一下代码, 可能是因为引用了 Host 来初始化 Razor 引擎, 导致升级到 3.x 比较困难。 可以考虑这中实现方式 https://github.com/adoconnection/RazorEngineCore 或者直接引用这个类库来替换现有的 Razor 实现 @Ahoo-Wang
将项目'SmartCode.CLI'的目标框架由netcoreapp2.2 改成netcoreapp3.1不就行了不是那么简单的, 2.x 到 3.x 的升级比较复杂, 尤其是 host 这部分。 不仅很多包都没有了, 而且用法也发生了很大的变化。
呃,貌似真没那么复杂,我就是这样做的,然后打了个包放到了私有库,不一样的正常使用嘛
这个真不一样, 得用 3.x 的 host 才算是真正的升级到了 3.x , 只改 BuildTarget 是不能算升级, 会被 @Ahoo-Wang 鄙视的
我之前改的时候,是准备把所有都升级一下,但是嫌麻烦,为了不装2.2的SDK,就简单这样改了
from smartcode.
不知道3.1版本现在进行到什么程度了,急呀。 @Ahoo-Wang
from smartcode.
楼主 可以考虑一个 api版本的 3.1先
from smartcode.
今天花了些时间, 用 https://github.com/adoconnection/RazorEngineCore 实现了一个新的模板引擎, 我的 fork 在这里 https://github.com/beginor/SmartCode。
注意, 这个只是 Razor 引擎, 而不是完整的 MVC 的 View , 所以肯定会少一些功能。
如果要使用新的 RazorCore 模板, 需要注意的地方有:
- 配置文件中的 Task 需要指定 TemplateEngine 的名称 (Name) 为
RazorCore
, 参考: https://github.com/beginor/SmartCode/blob/smartcode_master/doc/SmartCode-TypeScript.yml#L62 ; - 模板中原来指定
@model BuildContext
修改为@inherits SmartCode.TemplateEngine.Impl.RazorCoreTemplate<BuildContext>
; - 不支持
Layout
RenderPartial
和HtmlHelper
, 这些是 MVC 的 View 才有的东西; - 增加了
Include
方法, 方便使用重复的代码片段, 参考: https://github.com/beginor/SmartCode/blob/f9bbeca01ed1f624e9b51b9b5d1700bd065dbeff/src/SmartCode.Generator/RazorTemplates/TypeScript/Model.cshtml#L14 - 原来的
Html.PadLeft
Html.NewLine
几个扩展方法移动到了 RazorCoreTemplate 方法下面, 用法@Html.NewLine()
->@NewLine()
欲了解更多, 可以查看我这次提交的内容 beginor@f9bbeca
后续我会在我的库中删除 Hosting
以及 Mvc
这些死在 .net core 2.2 的僵尸类库, 并逐步修改现有的 Razor 模板。
from smartcode.
from smartcode.
Related Issues (20)
- 希望能新增Schema这个类,用于生成分层 HOT 2
- 建议依赖注入的容器不要太凌乱了 HOT 1
- 关于 ETL 的几点建议 HOT 1
- 提交建议:希望像mybatis提供编写外部插件的功能 HOT 2
- mac 使用错误 No such file or directory HOT 2
- SmartCode是否可以加入联合主键的识别和代码生成?
- 哪有教程教怎么写模板,好让我们贡献出来 HOT 1
- SmartCode文档太粗,能不能再细化
- 全大写数据库名称转换问题 HOT 1
- mysql中enum类型的字段,无法找到对应的CSharp类型。
- Partial类建议
- CSharp的Oracle模板中,关于Query的Sql语法错误
- Use .NET 5 as framework HOT 1
- 支持一对多,多对多的生成吗? HOT 4
- 升级 SmartCode 到 .Net 新版本的一些想法 HOT 7
- 更新mysql.data HOT 4
- SmartCode 版本不一致 HOT 1
- 在生成器中包含PG数据库的物化视图 (Materialized View)信息
- 老是报conda错误
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from smartcode.