├── .github └── ISSUE_TEMPLATE │ ├── feature_request.md │ ├── question.md │ └── bug_report.md ├── LICENSE ├── README.md └── .gitignore /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: 功能要求(Feature request) 3 | about: 为52ABP Code Power Tool提供您的建议和想法(Suggest an idea for this project) 4 | 5 | --- 6 | 7 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/question.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: 问题(Question) 3 | about: Issues 是用于BUG、Feature、进度追踪(The issue tracker is not for questions.) 4 | 5 | --- 6 | 7 | 🚨 Issues 是用于BUG、Feature、进度追踪 🚨 8 | 🚨 The issue tracker is not for questions 🚨 9 | 10 | 如果有任何问题,可在以下方式获得答案: 11 | 12 | - https://www.52abp.com/ 13 | - QQ Group:633751348 14 | 15 | 16 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: BUG反馈(Bug report) 3 | about: 帮助我们改进(Create a report to help us improve) 4 | --- 5 | 6 | **描述错误(Describe the bug)** 7 | 8 | 请尽量将错误描述的清楚而简洁。 9 | (A clear and concise description of what the bug is.) 10 | 11 | 使用的版本信息: 12 | 13 | - ABPCodePowerTools version: X.Y.Z 14 | 15 | **重现错误信息** 16 | 17 | 告诉我们是怎么操作的 18 | Steps to reproduce the behavior: 19 | 20 | 1. 点击了什么, 21 | 2. 哪个功能触发的 '....' 22 | 3. 看到的错误信息 '....' 23 | 24 | 错误代码: 25 | 26 | ``` 27 | error code 28 | ``` 29 | 30 | **Expected behavior** 31 | 32 | A clear and concise description of what you expected to happen. 33 | 34 | **截图-Screenshots** 35 | 36 | 如果可以的话,添加截图来帮助解释你的问题。 If applicable, add screenshots to help explain your problem. 37 | 38 | **Additional context** 39 | Add any other context about the problem here. 40 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 52ABP 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 52ABP.CodeGenerator 2 | 52ABP的代码生成器,反馈收集问题和文档信息。 3 | ## 前言 4 | 5 | 但是这个月好歹抽空做了一些事情,嗯。就是一直说的ABP 的新版本代码生成器,之前的代码生成器大家说不支持.NET CORE。 6 | 现在这个版本终于支持了。 7 | 也算是兑现了承诺。 8 | > ABP Code Generator 是基于ABP(ASP.NET Boilerplate)框架制作的代码生成器,可以用于大家在日常开发过程中节约时间,把更多的精力放于业务逻辑的处理中。 9 | 10 | > 欢迎您使用 ABP Code Generator ,重新开发的代码生成器,[支持.net framework和.net](http://xn--framework-yw9o.net/) core 双版本。 11 | 开发代码生成器的初衷是为了让大家专注于业务开发,而基础设施的地方,由代码生成器实现,节约大家的实现。实现提高效率、共赢的局面。 欢迎到:[https://github.com/52ABP/52ABP.CodeGenerator](https://github.com/52ABP/52ABP.CodeGenerator) 提供您的脑洞,如果合理的我会实现哦~ 12 | 13 | 下载地址: https://marketplace.visualstudio.com/items?itemName=werltm.52ABPCodeGenerator 14 | 15 | 16 | 17 | 18 | # 说正事 19 | 20 | 在群里已经内测了一周多的时间,也算稳定了,终于可以做成教程出来见人了。 21 | #### 支持 Visual Studio 2015 和 Visual Studio 2017 哦 22 | ## 下载方式: 23 | 首先打开Visual Studio 的工具- 拓展和更新 菜单栏,见下图: 24 | ![菜单栏.png](http://upload-images.jianshu.io/upload_images/1979022-9e9af10a566e0b3c.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) 25 | 然后选择 **“联机”**菜单栏 ,再在右侧 搜索"ABP", 26 | ![image.png](http://upload-images.jianshu.io/upload_images/1979022-53a6a30af23e4d6d.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) 27 | 我们可以看到有4个工具。 28 | 我们都简单说明下: 29 | ABP Code Generator 是之前开发的,用的是基架体系可以参考文章:http://t.cn/RRMQQhS 30 | ![ABP Code Generator.png](http://upload-images.jianshu.io/upload_images/1979022-eedee2ec9463687d.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) 31 | 32 | ABP Code Power Tools 是目前支持.Net Framework 和.NET Core的代码生成器。 33 | ![image.png](http://upload-images.jianshu.io/upload_images/1979022-39b2a8f1c1ffb1b7.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) 34 | 也是接下来会持续进行更新的项目之一。 35 | 36 | 后面的ABPHelper 是国外的一个人开发的,大家有兴趣也可以使用。 37 | 最后的ASP.NET Zero Power Tools是ABP官方推出的代码生成器,功能强大,唯一的问题就是要**给钱**。 38 | 39 | # 如何使用 40 | 只要是ABP的项目无论是Core还是Framework 版本都可以。 41 | 打开解决方案,选择Core层。 42 | ![image.png](http://upload-images.jianshu.io/upload_images/1979022-8d29b2684ea52597.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) 43 | 我们选择“Book”的实体文件, 44 | ``` 45 | using Abp.Domain.Entities; 46 | 47 | using System; 48 | using System.Collections.Generic; 49 | using System.ComponentModel.DataAnnotations; 50 | using System.IO; 51 | using System.Linq; 52 | using System.Text; 53 | 54 | namespace SmartToken.Persons 55 | { 56 | public class Book:Entity 57 | { 58 | 59 | [Required] 60 | [MaxLength(32)] 61 | public virtual string Name { get; set; } 62 | 63 | [Required] 64 | [MaxLength(32)] 65 | public virtual string Surname { get; set; } 66 | 67 | [MaxLength(255)] 68 | public virtual string EmailAddress { get; set; } 69 | } 70 | } 71 | ``` 72 | 在实体文件"Book"上右键点击 73 | ![右键.png](http://upload-images.jianshu.io/upload_images/1979022-2ff312fa3c86b67d.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) 74 | 展开对话框 75 | ![基本信息配置.png](http://upload-images.jianshu.io/upload_images/1979022-0bd77cd646bee086.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) 76 | 77 | > 说下重点,如果是刚刚生成器的ABP空项目,请选择“第一次使用代码生成器”,它会帮助您生成相关的基类代码。 78 | 79 | >另外选择你的项目版本比如是.NET Core 和.Net Framework 80 | 81 | 然后点击确定 82 | ![Dto信息](http://upload-images.jianshu.io/upload_images/1979022-8bec982f44295d23.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) 83 | 选择要生成的字段信息。点击确定即可。 84 | 以下是生成的文件信息: 85 | 86 | ![Core层.png](http://upload-images.jianshu.io/upload_images/1979022-b1907fd6b1079d37.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) 87 | 88 | ![Application层.png](http://upload-images.jianshu.io/upload_images/1979022-7d2821eec448df6d.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) 89 | 90 | 生成了领域层和应用层的相关代码,涉及的功能有: 91 | 领域层初始化、AutoMapper自动注入、表的增删改查、批量删除、单数据修改等功能。 92 | 基本上来说和上一个版本的代码生成器差不多。 93 | 94 | 但是功能还不够。 95 | 所以我们要说接下来的事情了 96 | 97 | 98 | 99 | # 路线图 100 | - 生成ReadMe手册 101 | - 完善基础设施层的代码 102 | - 完善bug 103 | - 针对视图层增加代码段。 104 | 105 | 另外欢迎到:https://github.com/52ABP/52ABP.CodeGenerator 106 | 欢迎 Star ,然后提出您的想法和意见。 107 | 108 | # 现在的成绩 109 | 目前 版本还是1.0 后续做更多的迭代。请大家耐心等待。 110 | 111 | 意外的小惊喜就是今天居然上了最常用榜单有点意外。难道大家都去过年了吗? 112 | ![image.png](http://upload-images.jianshu.io/upload_images/1979022-a22cd2db19e701e4.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) 113 | 114 | > 交流QQ群:104390185 115 | 116 | 117 | 118 | 最后祝大家: 119 | 大家新年快乐。 120 | ##  -*About Me-* 121 | 122 | ![image](http://upload-images.jianshu.io/upload_images/1979022-9e2bbb5c0bca57f2?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) 123 | 124 | 125 | 126 | 127 | ![image](http://upload-images.jianshu.io/upload_images/1979022-bd2643389761d9ef?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) 128 | 129 | 130 | 131 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.suo 8 | *.user 9 | *.userosscache 10 | *.sln.docstates 11 | 12 | # User-specific files (MonoDevelop/Xamarin Studio) 13 | *.userprefs 14 | 15 | # Build results 16 | [Dd]ebug/ 17 | [Dd]ebugPublic/ 18 | [Rr]elease/ 19 | [Rr]eleases/ 20 | x64/ 21 | x86/ 22 | bld/ 23 | [Bb]in/ 24 | [Oo]bj/ 25 | [Ll]og/ 26 | 27 | # Visual Studio 2015 cache/options directory 28 | .vs/ 29 | # Uncomment if you have tasks that create the project's static files in wwwroot 30 | #wwwroot/ 31 | 32 | # MSTest test Results 33 | [Tt]est[Rr]esult*/ 34 | [Bb]uild[Ll]og.* 35 | 36 | # NUNIT 37 | *.VisualState.xml 38 | TestResult.xml 39 | 40 | # Build Results of an ATL Project 41 | [Dd]ebugPS/ 42 | [Rr]eleasePS/ 43 | dlldata.c 44 | 45 | # .NET Core 46 | project.lock.json 47 | project.fragment.lock.json 48 | artifacts/ 49 | **/Properties/launchSettings.json 50 | 51 | *_i.c 52 | *_p.c 53 | *_i.h 54 | *.ilk 55 | *.meta 56 | *.obj 57 | *.pch 58 | *.pdb 59 | *.pgc 60 | *.pgd 61 | *.rsp 62 | *.sbr 63 | *.tlb 64 | *.tli 65 | *.tlh 66 | *.tmp 67 | *.tmp_proj 68 | *.log 69 | *.vspscc 70 | *.vssscc 71 | .builds 72 | *.pidb 73 | *.svclog 74 | *.scc 75 | 76 | # Chutzpah Test files 77 | _Chutzpah* 78 | 79 | # Visual C++ cache files 80 | ipch/ 81 | *.aps 82 | *.ncb 83 | *.opendb 84 | *.opensdf 85 | *.sdf 86 | *.cachefile 87 | *.VC.db 88 | *.VC.VC.opendb 89 | 90 | # Visual Studio profiler 91 | *.psess 92 | *.vsp 93 | *.vspx 94 | *.sap 95 | 96 | # TFS 2012 Local Workspace 97 | $tf/ 98 | 99 | # Guidance Automation Toolkit 100 | *.gpState 101 | 102 | # ReSharper is a .NET coding add-in 103 | _ReSharper*/ 104 | *.[Rr]e[Ss]harper 105 | *.DotSettings.user 106 | 107 | # JustCode is a .NET coding add-in 108 | .JustCode 109 | 110 | # TeamCity is a build add-in 111 | _TeamCity* 112 | 113 | # DotCover is a Code Coverage Tool 114 | *.dotCover 115 | 116 | # Visual Studio code coverage results 117 | *.coverage 118 | *.coveragexml 119 | 120 | # NCrunch 121 | _NCrunch_* 122 | .*crunch*.local.xml 123 | nCrunchTemp_* 124 | 125 | # MightyMoose 126 | *.mm.* 127 | AutoTest.Net/ 128 | 129 | # Web workbench (sass) 130 | .sass-cache/ 131 | 132 | # Installshield output folder 133 | [Ee]xpress/ 134 | 135 | # DocProject is a documentation generator add-in 136 | DocProject/buildhelp/ 137 | DocProject/Help/*.HxT 138 | DocProject/Help/*.HxC 139 | DocProject/Help/*.hhc 140 | DocProject/Help/*.hhk 141 | DocProject/Help/*.hhp 142 | DocProject/Help/Html2 143 | DocProject/Help/html 144 | 145 | # Click-Once directory 146 | publish/ 147 | 148 | # Publish Web Output 149 | *.[Pp]ublish.xml 150 | *.azurePubxml 151 | # TODO: Comment the next line if you want to checkin your web deploy settings 152 | # but database connection strings (with potential passwords) will be unencrypted 153 | *.pubxml 154 | *.publishproj 155 | 156 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 157 | # checkin your Azure Web App publish settings, but sensitive information contained 158 | # in these scripts will be unencrypted 159 | PublishScripts/ 160 | 161 | # NuGet Packages 162 | *.nupkg 163 | # The packages folder can be ignored because of Package Restore 164 | **/packages/* 165 | # except build/, which is used as an MSBuild target. 166 | !**/packages/build/ 167 | # Uncomment if necessary however generally it will be regenerated when needed 168 | #!**/packages/repositories.config 169 | # NuGet v3's project.json files produces more ignorable files 170 | *.nuget.props 171 | *.nuget.targets 172 | 173 | # Microsoft Azure Build Output 174 | csx/ 175 | *.build.csdef 176 | 177 | # Microsoft Azure Emulator 178 | ecf/ 179 | rcf/ 180 | 181 | # Windows Store app package directories and files 182 | AppPackages/ 183 | BundleArtifacts/ 184 | Package.StoreAssociation.xml 185 | _pkginfo.txt 186 | 187 | # Visual Studio cache files 188 | # files ending in .cache can be ignored 189 | *.[Cc]ache 190 | # but keep track of directories ending in .cache 191 | !*.[Cc]ache/ 192 | 193 | # Others 194 | ClientBin/ 195 | ~$* 196 | *~ 197 | *.dbmdl 198 | *.dbproj.schemaview 199 | *.jfm 200 | *.pfx 201 | *.publishsettings 202 | orleans.codegen.cs 203 | 204 | # Since there are multiple workflows, uncomment next line to ignore bower_components 205 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 206 | #bower_components/ 207 | 208 | # RIA/Silverlight projects 209 | Generated_Code/ 210 | 211 | # Backup & report files from converting an old project file 212 | # to a newer Visual Studio version. Backup files are not needed, 213 | # because we have git ;-) 214 | _UpgradeReport_Files/ 215 | Backup*/ 216 | UpgradeLog*.XML 217 | UpgradeLog*.htm 218 | 219 | # SQL Server files 220 | *.mdf 221 | *.ldf 222 | *.ndf 223 | 224 | # Business Intelligence projects 225 | *.rdl.data 226 | *.bim.layout 227 | *.bim_*.settings 228 | 229 | # Microsoft Fakes 230 | FakesAssemblies/ 231 | 232 | # GhostDoc plugin setting file 233 | *.GhostDoc.xml 234 | 235 | # Node.js Tools for Visual Studio 236 | .ntvs_analysis.dat 237 | node_modules/ 238 | 239 | # Typescript v1 declaration files 240 | typings/ 241 | 242 | # Visual Studio 6 build log 243 | *.plg 244 | 245 | # Visual Studio 6 workspace options file 246 | *.opt 247 | 248 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 249 | *.vbw 250 | 251 | # Visual Studio LightSwitch build output 252 | **/*.HTMLClient/GeneratedArtifacts 253 | **/*.DesktopClient/GeneratedArtifacts 254 | **/*.DesktopClient/ModelManifest.xml 255 | **/*.Server/GeneratedArtifacts 256 | **/*.Server/ModelManifest.xml 257 | _Pvt_Extensions 258 | 259 | # Paket dependency manager 260 | .paket/paket.exe 261 | paket-files/ 262 | 263 | # FAKE - F# Make 264 | .fake/ 265 | 266 | # JetBrains Rider 267 | .idea/ 268 | *.sln.iml 269 | 270 | # CodeRush 271 | .cr/ 272 | 273 | # Python Tools for Visual Studio (PTVS) 274 | __pycache__/ 275 | *.pyc 276 | 277 | # Cake - Uncomment if you are using it 278 | # tools/** 279 | # !tools/packages.config 280 | 281 | # Telerik's JustMock configuration file 282 | *.jmconfig 283 | 284 | # BizTalk build output 285 | *.btp.cs 286 | *.btm.cs 287 | *.odx.cs 288 | *.xsd.cs 289 | --------------------------------------------------------------------------------