[英]Where I can find script in project files in asp.net webAPI app?
I create simple asp.net WEB API application.我创建了简单的 asp.net WEB API 应用程序。 When I run it, i see this view:当我运行它时,我看到了这个视图:
When I try to inspect code i see that in there are some scripts of course, but i cant find this scripts in my file in Visual Studio (project was generated automatically)... Can someone tells me why?当我尝试检查代码时,我看到其中当然有一些脚本,但我在 Visual Studio 的文件中找不到这些脚本(项目是自动生成的)......有人能告诉我为什么吗?
It is located in the weather forecast controller它位于天气预报 controller
There you find你在那里找到
public IEnumerable<WeatherForecast> Get()
{
var rng = new Random();
return Enumerable.Range(1, 5).Select(index => new WeatherForecast
{
Date = DateTime.Now.AddDays(index),
TemperatureC = rng.Next(-20, 55),
Summary = Summaries[rng.Next(Summaries.Length)]
})
.ToArray();
}
As you can see it creates 5 "WeatherForecast" with random numbers如您所见,它创建了 5 个带有随机数的“WeatherForecast”
The diplay part happens here.显示部分发生在这里。
app.UseEndpoints(endpoints =>
{
endpoints.MapControllers();
});
For the rest pkease check the documentation对于 rest pkease 检查文档
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.