首页 > 编程语言 >学习009-01 Create a Standalone Web API Application(创建一个独立的 Web API 应用程序 )

学习009-01 Create a Standalone Web API Application(创建一个独立的 Web API 应用程序 )

时间:2024-08-15 10:52:10浏览次数:9  
标签:Web 01 Core 应用程序 API NET XAF

Create a Standalone Web API Application(创建一个独立的 Web API 应用程序 )

This topic contains step-by-step instructions on how to create an application with the Web API. For more information on the Web API, see the following topic: Backend Web API Service.
本主题包含有关如何使用Web API创建应用程序的分步说明。有关Web API的更多信息,请参阅以下主题:后端Web API服务。

Note
The Solution Wizard template for Web API .NET 6-based projects is available in Visual Studio 2022+ after you run the Universal Component Installer from the Download Manager.
Web API的解决方案向导模板。从下载管理器运行通用组件安装程序后,基于NET 6的项目在Visual Studio 2022+中可用。

1.Create a new solution in Visual Studio. Select the DevExpress v24.1 XAF Template Gallery project template and click Next.
在Visual Studio中创建新解决方案。选择DevExpress v24.1 XAF Template Gallery项目模板,然后单击Next。
在这里插入图片描述

2.Specify the name and location of the new project (solution), and click Create.
指定新项目(解决方案)的名称和位置,然后单击创建。

3.Ensure that the .NET Core platform is selected and run the XAF Solution Wizard.
确保.NET Core平台被选中并运行XAF解决方案向导。
在这里插入图片描述

4.In the Solution Wizard, select Service (ASP.NET Core Web API) and other platforms that you wish to add to the solution.
在解决方案向导中,选择要添加到解决方案的服务( ASP.NET Core Web API)和其他平台。
在这里插入图片描述

5.Select the eXpress Persistent Objects or Entity Framework Core ORM for your application and click Next.
为您的应用程序选择 eXpress Persistent Objects or Entity Framework Core ORM,然后单击下一步。
在这里插入图片描述

6.Choose the security options for your application.
为您的应用程序选择安全选项。
在这里插入图片描述

See the following topic for details: Authentication in Web API projects.
有关详细信息,请参阅以下主题:Web API项目中的身份验证。

If you selected ASP.NET Core Blazor on the Choose Target Platforms page, you can also specify if the Web API service should be added as a separate project or integrated into a Blazor application project:
如果您在选择目标平台页面上选择了ASP.NETCore Blazor,您还可以指定是否应将Web API服务添加为单独的项目或集成到Blazor应用程序项目中:
在这里插入图片描述

7.Select additional modules, if necessary. See the following documentation section for additional information on these extra modules: Paid/Enterprise Modules.
如有必要,请选择其他模块。有关这些额外模块的更多信息,请参阅以下留档部分:付费/企业模块。
在这里插入图片描述

8.Create endpoints and test the Web API.
创建端点并测试Web API。

9.This step only applies if you used the “Sha512” algorithm to encrypt passwords in your existing XAF application and want to reuse the same database. In such instances, set the PasswordCryptographer.SupportLegacySha512 property to true for backward compatibility.
仅当您使用"Sha512"算法加密现有XAF应用程序中的密码并希望重用同一数据库时,此步骤才适用。在这种情况下,请将PasswordCryptographer. SupportLegacySha512属性设置为true以实现向后兼容性。

File: MySolution.WebApi\Startup.cs

C#

public class Startup {
    // ...
    public void ConfigureServices(IServiceCollection services) {
        // ...
        PasswordCryptographer.SupportLegacySha512 = true;
        // ...
    }
}

标签:Web,01,Core,应用程序,API,NET,XAF
From: https://blog.csdn.net/thomastang200912_126/article/details/141216711

相关文章

  • [nRF24L01+] 4. 增强型ShockBurst
    4.增强型ShockBurst增强型的ShockBurst是一个数据链路层,具有自动数据包组装和数据包的发送、定时、自动确认和重传。这些特性能够显著提高双向和单向系统的能效,而不会增加主机控制器侧的复杂性。增强型ShockBurst™数据包事务是一种数据包交换,其中一个收发器充当主收发器(PRX,P......
  • [nRF24L01+] 5. 数据和控制接口
    5.数据和控制接口5.1.特点管脚:IRQ(该信号为低电平有效信号,由三个可屏蔽中断源控制)CE(此信号为高电平,用于在RX或TX模式下激活芯片)CSN(SPI信号)SCK(SPI信号)MOSI(SPI信号)MISO(SPI信号)SPI:速率:0-10Mbps5.2.SPI命令5.2.1.命令格式<Commandword:MSBittoLSBit(onebyte......
  • [nRF24L01+] 3. Radio Control 无线电控制
    3.RadioControl无线电控制nRF24L01+可以配置为:powerdown,standby,Rx/Txmode3.1.无线控制状态图当VDD电压大于1.9V时,进入上电复位状态,并保持复位状态,直到进入掉电模式:需要注意的是:从待机模式到TX/RX模式的过度时间,和反过来,从TX/RX模式到待机模式的过渡时间是相同的;......
  • [nRF24L01+] 1. 硬件设计
    nRF24L01pluss_REFERENCE_MODULES.pdfnrf24l01p_product_specification_1_0.pdf1.硬件设计1.1.实物图[左边是PCB天线,右边是SMA连接器接天线]1.2.接口示意图[接口方块图][接口定义]1.3.电路图[电路图]不同芯片的天线BOM物料差别:RefL01+LE1-Q48LE1-Q3......
  • NSSCTF [GXYCTF 2019]Ping Ping Ping
    ping命令,这是老朋友了,经常碰见,先进题目界面看看 先试试直接输入一个地址,127.0.0.1,看看有没有回显 那就是一个ping命令了,直接先试试管道'|',look一下有没有被过滤掉,输入"127.0.0.1|ls" 出来了,说明管道命令可以用,那接下来就简单了。直接查看一下flag.php,输入"127.......
  • fastapi 使用sqlalchemy
    一、简介fastapi常见的orm框架有以下几种:SQLAlchemy:这个比较常见,之前用flask开发web框架也用的SQLAlchemy。SQLModel:网上说是最适合fastapi的orm框架,官方也推荐这个,后续应该会发展不错,目前没有去踩坑。tortoise-orm:django的异步orm框架,与fastapi也兼容,没用过不做评价。 ......
  • PHP转Go系列 | ThinkPHP与Gin框架之打造基于WebSocket技术的消息推送中心
    大家好,我是码农先森。在早些年前客户端想要实时获取到最新消息,都是使用定时长轮询的方式,不断的从服务器上获取数据,这种粗暴的骚操作实属不雅。不过现如今我也还见有人还在一些场景下使用,比如在PC端扫描二维码,然后使用长轮询的方式从服务端获取最新的扫码信息,来判断用户是否已经......
  • java语言,MySQL数据库;基于Web的高校知识共享系统设计与实现 32050(免费领源码)计算机毕业
    摘 要信息化社会内需要与之针对性的信息获取途径,但是途径的扩展基本上为人们所努力的方向,由于站在的角度存在偏差,人们经常能够获得不同类型信息,这也是技术最为难以攻克的课题。针对高校知识共享系统等问题,对高校知识共享系统进行研究分析,然后开发设计出高校知识共享系统以......
  • 05 内部类&API&异常
    目录1.内部类    1.1形参和返回值    1.2内部类    1.3 成员内部类    1.4局部内部类     1.5匿名内部类2.Math    1.Math类概述3.System4.Object5.Arrays6.基本类型包装类7.日期类    1.Dat......
  • Datawhale AI夏令营 大模型(微调)Task01
    这次这个Task与以往有些不同,通过调节外部参数prompt和扩充数据来提高预测得分的大模型微调任务。此次任务最大的不同是不在修改代码去提高程序预测准确性,所以这次对大模型的训练的难点在与大模型所需的prompt与数据量上。下面是跟着教程做的一些步骤。1.首先是报名赛事。由......