当前位置:网站首页>Development of Taurus. MVC WebAPI introductory tutorial 1: download environment configuration and operation framework (including series directory).
Development of Taurus. MVC WebAPI introductory tutorial 1: download environment configuration and operation framework (including series directory).
2022-08-04 02:11:00 【[Unreal private school]】
优质资源分享
学习路线指引(点击解锁) | 知识定位 | 人群定位 |
---|---|---|
🧡 Python实战微信订餐小程序 🧡 | 进阶级 | 本课程是python flask+微信小程序的完美结合,从项目搭建到腾讯云部署上线,打造一个全栈订餐系统. |
Python量化交易实战 | 入门级 | 手把手带你打造一个易扩展、更安全、效率更高的量化交易系统 |
前言:
Taurus.MVC The microservice version has been released:Taurus.MVC V3.0.3 微服务开源框架发布:让.NET 架构在大并发的演进过程更简单.
In the past, I wrote articles about related function points when the framework was released,No series is formed.
因此,Plan to add some detailed introductory development tutorials,The contents of this series of tutorials are as follows:
1、Taurus.MVC WebAPI 入门开发教程1:Framework download environment configuration and operation.
2、Taurus.MVC WebAPI 入门开发教程2:Add controller outputHello World.
3、Taurus.MVC WebAPI 入门开发教程3:Route types and route maps.
4、Taurus.MVC WebAPI 入门开发教程4:Controller method and parameter definitions、Get and base validation properties【Require】.
5、Taurus.MVC WebAPI 入门开发教程5:Controller security validation properties【HttpGet、HttpPost】【Ack】【Token】【MicroService】.
6、Taurus.MVC WebAPI 入门开发教程6:全局控制器DefaultControllerwith global events.
7、Taurus.MVC WebAPI 入门开发教程7:Business logic base classLogicBase的使用.
8、Taurus.MVC WebAPI 入门开发教程8:WebAPIDocumentation and automated tests.
Two additional series follow:
1、Taurus.MVC 微服务 Introductory development tutorial series.
2、Taurus.MVC Web应用 Introductory development tutorial series.
Let's start with the first tutorial in this series:
Cite source code:下载框架Taurus.MVC
开源地址:https://github.com/cyq1162/Taurus.MVC
Cite source code:1、打开项目工程:
1、Taurus.MVC.sln :.Net Framework 版本,部署在Window平台.(建议:VS2012以上,直接运行时web.configTurn on classic mode registration,Keep it the same as the picture below)
**2、Taurus.MVC_NetCore :**支持.NET Core series andNET5、NET6、NET7…以及未来版本.(建议:VS2017以上,当前最新VS2022)
说明:
Frameworks have references by default:Package中的CYQ.Data.dll,If the project operation reports related errors,重新引用即可.
若有需要,也可以引用CYQ.Data的源码项目:[https:](https://blog.csdn.net/biggbang)[//github.com/cyq1162/cyqdata](https://blog.csdn.net/biggbang)
Cite source code:2、F5运行工程项目
.NET Bottom version selection:
可以根据需要:
1、.NET版本2.0到4.N版本
2、.NET Core2.1 到.NET6、.NET7及未来版本.
The framework is strong,It's about adapting from early to future,Can adapt to Microsoft's unlimited underlying upgrades,The development code at the application level does not require code migration.
运行成功时:
说明:
源码项目,默认包含MVC的界面,还有Demo控制器,对于WebAPI开发而言,都是可以删除的.
The only catalog files to keep are :WebAPIDevelop documentation related interface files:
.NET :/View/Doc/...
.NET Core :/wwwroot/Views/Doc/.....
引用Nuget包方式:1、新建空项目:
1、ASP.NET 系列:
2、ASP.NET Core 系列:
引用Nuget包方式:2、引用Taurus.MVC:
nuget管理中,搜索taurus,Reference the version based on the project version:
.NET :Taurus.MVC
.NET Core :Taurus.MVC.Core
引用Nuget包方式:3、Configure interception entry
1、普通.Net Framework 项目,It is automatically generated when the package is referencedWeb.Config配置入口:
"Taurus.Core" type="Taurus.Core.UrlRewrite,Taurus.Core"/>
"false" />
"Taurus.Core" type="Taurus.Core.UrlRewrite,Taurus.Core"/>
2、.NET Core 项目,通过Startup.cs 配置入口:
public class Startup
{
// This method gets called by the runtime. Use this method to add services to the container.
// For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940
public void ConfigureServices(IServiceCollection services)
{
services.AddHttpContext();
services.Configure(x => x.AllowSynchronousIO = true).Configure(x => x.AllowSynchronousIO = true);
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
app.UseHttpContext();
app.UseTaurusMvc(env);
}
}
3、NET5、NET6、NET7…系列,通过Program.cs 配置入口:
var builder = WebApplication.CreateBuilder(args);
//补上Starpup的ConfigureServices:
builder.Services.Configure(x => x.AllowSynchronousIO = true).Configure(x => x.AllowSynchronousIO = true);builder.Services.AddHttpContext();
*var app = builder.Build();
//补上Starpup的Configure:
app.UseHttpContext();
app.UseTaurusMvc(app.Environment);
app.Run();*
NugetPackage reference method:4:F5运行工程项目
运行成功:(The prompt requires the controller to be coded,The next article adds a controller)
总结:
This article introduces two suggestionsTaurus.MVC WebAPI项目,And the initial run was successful.
The next article introduces the simple coding usage of the controller.
边栏推荐
- sql有关问题,小时粒度,找到前一个小时内的数据
- 静态/动态代理模式
- 织梦内核电动伸缩门卷闸门门业公司网站模板 带手机版【站长亲测】
- DHCP服务详解
- Instance, 038: the sum of the diagonal matrix
- initramfs详解----添加硬盘驱动并访问磁盘
- Continuing to invest in product research and development, Dingdong Maicai wins in supply chain investment
- Security First: Tools You Need to Know to Implement DevSecOps Best Practices
- QNX Hypervisor 2.2 user manual] 10.1 gm vdev options
- Web APIs BOM- 操作浏览器:swiper 插件
猜你喜欢
随机推荐
Day13 Postman的使用
Example 040: Reverse List
DDTL:远距离的域迁移学习
实例036:算素数
静态/动态代理模式
实例035:设置输出颜色
2022广东省安全员A证第三批(主要负责人)考试题库及模拟考试
lombok注解@RequiredArgsConstructor的使用
Continuing to invest in product research and development, Dingdong Maicai wins in supply chain investment
Intranet penetration - application
Parquet encoding
Continuing to invest in product research and development, Dingdong Maicai wins in supply chain investment
Parquet encoding
实例041:类的方法与变量
2022G1工业锅炉司炉考试练习题及模拟考试
pytorch应用于MNIST手写字体识别
sudo 权限控制,简易
APP电商如何快速分润分账?
How to copy baby from Taobao (or Tmall store) through API interface to Pinduoduo interface code docking tutorial
一篇文章看懂JS闭包,从执行上下文角度解析有趣的闭包