mirror of
https://github.com/anjoy8/Blog.Core.git
synced 2025-02-08 02:39:26 +08:00
Table of Contents
This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
生成整体框架多层类文件
项目开发后期,如果添加了一个表,但是需要生成四个层文件,比较麻烦,我根据SQL sugar相关内容,写了一个自动生成的方法。
注意:相关代码是 netcore 3.0分支的
上下文与操作类
Blog.Core.Model/Seed/MyContext.cs
Blog.Core.Model/Seed/FrameSeed.cs(可自定义文件生成路径)
依赖注入上下文
services.AddScoped<Blog.Core.Model.Models.MyContext>();
如何使用
Blog.Core/Controller/DbFirst/DbFirstController.cs
private readonly MyContext myContext;
/// <summary>
/// 构造函数
/// </summary>
/// <param name="myContext"></param>
public DbFirstController(MyContext myContext)
{
this.myContext = myContext;
}
/// <summary>
/// 获取 整体框架 文件
/// </summary>
/// <returns></returns>
[HttpGet]
public bool GetFrameFiles()
{
return FrameSeed.CreateModels(myContext)
&& FrameSeed.CreateIRepositorys(myContext)
&& FrameSeed.CreateIServices(myContext)
&& FrameSeed.CreateRepository(myContext)
&& FrameSeed.CreateServices(myContext)
;
}
入门指南
-
- AOP
- Appsettings
- Async-Await
- Authorization-Ids4
- Authorization-JWT
- AutoMapper
- CORS
- DI-AutoFac
- DI-NetCore
- Filter
- GlobalExceptionsFilter
- HttpContext
- Log4
- MemoryCache
- Middleware
- MiniProfiler
- publish
- Redis
- Repository
- SeedData
- SignalR
- SqlSugar
- SqlSugar-Codefirst&DataSeed
- SqlSugar-SqlAOP
- Swagger
- T4
- Test-xUnit
- Temple-Nuget
前端项目
交流与反馈
- FAQ page is a good place to see whether your question is already asked.
- Ask a question in cnblogs if you need help.
- Submit an issue if you found a bug or have a feature request.
- Open a pull request when you prepared to contribute. Before that, it is encouraged to open an issue to discuss.
更新日志
有疑问,请自行查看博客园文章:https://www.cnblogs.com/laozhang-is-phi/p/9495618.html#autoid-1-0-0
或者加 QQ 群:867095512