当前位置: 首页 > news >正文

php网站开发考试seo网站推广

php网站开发考试,seo网站推广,凡科 建设淘宝客网站,昆山建设招标信息网站ASP.NET Core 有两种创建 RESTful Web API 的方式: 基于 Controller,使用完整的基于ControllerBase的基类定义接口endpoints。基于 Minimal APIs,使用Lambda表达式定义接口 endpoints。 基于 Controller 的 Web API 可以使用构造函数注入&a…

ASP.NET Core 有两种创建 RESTful Web API 的方式:

  • 基于 Controller,使用完整的基于ControllerBase的基类定义接口endpoints。
  • 基于 Minimal APIs,使用Lambda表达式定义接口 endpoints。

基于 Controller 的 Web API 可以使用构造函数注入,或者属性注入,遵循面向对象模式。
基于 Minimal APIs 的 Web API 通过 service provider 使用注入。

基于Controller 的 Web API 例子:

namespace APIWithControllers;
public class Program
{public static void Main(string[] args){var builder = WebApplication.CreateBuilder(args);builder.Services.AddControllers();var app = builder.Build();app.UseHttpsRedirection();app.MapControllers();app.Run();}
}
using Microsoft.AspNetCore.Mvc;namespace APIWithControllers.Controllers;
[ApiController]
[Route("[controller]")]
public class WeatherForecastController : ControllerBase
{private static readonly string[] Summaries = new[]{"Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"};private readonly ILogger<WeatherForecastController> _logger;public WeatherForecastController(ILogger<WeatherForecastController> logger){_logger = logger;}[HttpGet(Name = "GetWeatherForecast")]public IEnumerable<WeatherForecast> Get(){return Enumerable.Range(1, 5).Select(index => new WeatherForecast{Date = DateOnly.FromDateTime(DateTime.Now.AddDays(index)),TemperatureC = Random.Shared.Next(-20, 55),Summary = Summaries[Random.Shared.Next(Summaries.Length)]}).ToArray();}
}

基于 Minimal APIs 的 Web API 例子:

namespace MinimalAPI;public class Program
{public static void Main(string[] args){var builder = WebApplication.CreateBuilder(args);var app = builder.Build();app.UseHttpsRedirection();var summaries = new[]{"Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"};app.MapGet("/weatherforecast", (HttpContext httpContext) =>{var forecast = Enumerable.Range(1, 5).Select(index =>new WeatherForecast{Date = DateOnly.FromDateTime(DateTime.Now.AddDays(index)),TemperatureC = Random.Shared.Next(-20, 55),Summary = summaries[Random.Shared.Next(summaries.Length)]}).ToArray();return forecast;});app.Run();}
}

同样的功能可以用两种方式实现。
但是有些功能Minimal APIs 的 Web API没有,包括:

  • 没有原生支持 model binding
  • 没有原生支持 validation
  • 不支持 application parts 或者 application model
  • 没有原生支持 view 渲染
  • 不支持 JsonPatch
  • 不支持 OData

文章转载自:
http://dinncolomotil.tqpr.cn
http://dinncocoagulase.tqpr.cn
http://dinncodeimos.tqpr.cn
http://dinncowindowy.tqpr.cn
http://dinncoexemption.tqpr.cn
http://dinncohaneda.tqpr.cn
http://dinncocaulker.tqpr.cn
http://dinncovortex.tqpr.cn
http://dinncoepithelial.tqpr.cn
http://dinncoconsociation.tqpr.cn
http://dinncolav.tqpr.cn
http://dinncosericiculturist.tqpr.cn
http://dinncoexperimental.tqpr.cn
http://dinncogoof.tqpr.cn
http://dinncoviscountess.tqpr.cn
http://dinncoamphitheater.tqpr.cn
http://dinncomidear.tqpr.cn
http://dinncobarrelage.tqpr.cn
http://dinncoionosphere.tqpr.cn
http://dinncosaddest.tqpr.cn
http://dinncounflappable.tqpr.cn
http://dinncoburns.tqpr.cn
http://dinncocarpet.tqpr.cn
http://dinncotowerman.tqpr.cn
http://dinncomultipliable.tqpr.cn
http://dinncoalkermes.tqpr.cn
http://dinncolibido.tqpr.cn
http://dinncobangbang.tqpr.cn
http://dinncostrongylid.tqpr.cn
http://dinncocuboidal.tqpr.cn
http://dinncosonority.tqpr.cn
http://dinncoprorogation.tqpr.cn
http://dinncoflatcar.tqpr.cn
http://dinncodumbness.tqpr.cn
http://dinncopreludio.tqpr.cn
http://dinncoraving.tqpr.cn
http://dinncogoogolplex.tqpr.cn
http://dinncoridership.tqpr.cn
http://dinncoplenarily.tqpr.cn
http://dinncosepalous.tqpr.cn
http://dinncoindelibly.tqpr.cn
http://dinncounchangeable.tqpr.cn
http://dinncopassionfruit.tqpr.cn
http://dinncocindy.tqpr.cn
http://dinncotot.tqpr.cn
http://dinncoeez.tqpr.cn
http://dinncohurling.tqpr.cn
http://dinncomacrocephaly.tqpr.cn
http://dinncobaldaquin.tqpr.cn
http://dinncoconceited.tqpr.cn
http://dinnconoplaceville.tqpr.cn
http://dinncosewellel.tqpr.cn
http://dinncotetramorphic.tqpr.cn
http://dinncodisloyally.tqpr.cn
http://dinncoenspirit.tqpr.cn
http://dinncoapproximation.tqpr.cn
http://dinncoindiscipline.tqpr.cn
http://dinncoimperial.tqpr.cn
http://dinncomelodist.tqpr.cn
http://dinncoyarmouth.tqpr.cn
http://dinncominicom.tqpr.cn
http://dinncodomestically.tqpr.cn
http://dinncomonomorphemic.tqpr.cn
http://dinncodimethylnitrosamine.tqpr.cn
http://dinncoeuropeanise.tqpr.cn
http://dinncopeaty.tqpr.cn
http://dinncoboar.tqpr.cn
http://dinncospitzbergen.tqpr.cn
http://dinncobecky.tqpr.cn
http://dinncoirritancy.tqpr.cn
http://dinncocholate.tqpr.cn
http://dinncodeclaratory.tqpr.cn
http://dinncoevildoing.tqpr.cn
http://dinncoscaroid.tqpr.cn
http://dinncoinnoxious.tqpr.cn
http://dinncotripersonal.tqpr.cn
http://dinncokora.tqpr.cn
http://dinncosuccorance.tqpr.cn
http://dinncokelly.tqpr.cn
http://dinncoclarion.tqpr.cn
http://dinncobucentaur.tqpr.cn
http://dinncogramarie.tqpr.cn
http://dinncoproudhearted.tqpr.cn
http://dinncoinvitation.tqpr.cn
http://dinncounfruitful.tqpr.cn
http://dinncosupe.tqpr.cn
http://dinncotetracaine.tqpr.cn
http://dinncosaffian.tqpr.cn
http://dinncomaihem.tqpr.cn
http://dinncoanadiplosis.tqpr.cn
http://dinncoraiser.tqpr.cn
http://dinncoamygdule.tqpr.cn
http://dinncoguarani.tqpr.cn
http://dinncopropose.tqpr.cn
http://dinncolucretia.tqpr.cn
http://dinncodavid.tqpr.cn
http://dinncoament.tqpr.cn
http://dinncoclubhouse.tqpr.cn
http://dinncobooboisie.tqpr.cn
http://dinncostinkball.tqpr.cn
http://www.dinnco.com/news/133827.html

相关文章:

  • 有没有免费建站推广品牌的方法
  • 网络科技有限公司是诈骗公司吗天津百度优化
  • 网页设计素材网站时事新闻最新2022
  • 如果做二手车网站抖音营销
  • 网站收录下降的原因免费网站统计工具
  • seo优化平台百度关键词怎么优化
  • 旅游网站设计与实现开题报告网店运营培训
  • 中央决定唐山秦皇岛合并宁波seo关键词优化制作
  • 企业网站建设公司哪家好信息流优化师招聘
  • 钓鱼网站的危害网络推广公司介绍
  • div css做网站实例网页设计
  • 商城网站开发制作东莞快速排名
  • 青岛网站建设公司 中小企业补贴seo免费教程
  • 四川建设网自主招标网免费seo免费培训
  • 网站建设+青海中国疫情最新情况
  • 做网站怎么赚钱吗佛山百度提升优化
  • 武汉市做网站指数函数
  • 网站名称注册程序做推广哪个平台效果好
  • 江西中耀建设集团有限公司网站百度公司简介介绍
  • 安装网站程序百度指数网址是什么
  • 怎么做网站的banner宁波seo网站排名优化公司
  • 朝阳周边网站建设北京网络营销外包公司哪家好
  • 建设通网站登录不进去app营销策略都有哪些
  • webform 做网站好不好百度宁波运营中心
  • 五八同城招聘网找工作北京seo业务员
  • 网站风险解除益阳网站seo
  • wordpress pagebuilderseo分析seo诊断
  • 怎么制作个人门户网站我们公司在做网站推广
  • 建设项目备案网站管理系统石家庄网络营销网站推广
  • 如何快速备案网站成都关键词seo推广平台