上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 44 下一页
摘要: 1.第一步: 在启动文件中加入 builder.Services.AddHttpClient(); 2. 第二步: using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using System.Net.Http; name 阅读全文
posted @ 2024-08-06 15:55 龙卷风吹毁停车场 阅读(29) 评论(0) 推荐(0)
摘要: 1. 选择右侧项目文件,单机右键,选择"编辑项目文件",打开如下 <Project Sdk="Microsoft.NET.Sdk.Web"> <PropertyGroup> <TargetFramework>net8.0</TargetFramework> //<Nullable>enable</N 阅读全文
posted @ 2024-08-05 11:08 龙卷风吹毁停车场 阅读(32) 评论(0) 推荐(0)
摘要: 读取单个配置 举例: 获取mes的内容 第一种方式: 使用IConfiguration app.MapGet("/test", (IConfiguration configuration) => { return configuration["mes"]; }); 第二种,getvalue获取 ap 阅读全文
posted @ 2024-08-04 17:53 龙卷风吹毁停车场 阅读(126) 评论(0) 推荐(0)
摘要: 在启动项 Program.cs 文件中添加 //app.UseStaticFiles(); // 启动静态文件中间件,默认访问wwwroot app.UseStaticFiles(new StaticFileOptions() { //修改默认访问地址为MyStaticFiles文件 FilePro 阅读全文
posted @ 2024-08-04 17:16 龙卷风吹毁停车场 阅读(11) 评论(0) 推荐(0)
摘要: 1.第一步首先创建一个webapi项目2.安装nuget包: Microsoft.AspNetCore.Authentication.JwtBearer 3.,然后再Program.cs文件中添加 4.然后运行起来 5. 打开 jwt.io 网站,解密token 关于: iss, sub, exp, 阅读全文
posted @ 2024-07-15 15:05 龙卷风吹毁停车场 阅读(29) 评论(0) 推荐(0)
摘要: //nuget安装: Microsoft.Extensions.DependencyInjection //ServiceCollection的生命周期 //AddTransient 瞬时生命周期,每次创建都是一个全新的实例 //AddSingleton 单列生命周期,同一个类型创建出来的是同一个实 阅读全文
posted @ 2024-07-12 16:41 龙卷风吹毁停车场 阅读(14) 评论(0) 推荐(0)
摘要: 2.第二步,要想session正常使用,在启动文件中配置如下 3.第三步,接受数据 阅读全文
posted @ 2024-07-10 09:08 龙卷风吹毁停车场 阅读(10) 评论(0) 推荐(0)
摘要: 在实体框架Entity Framework Core 中,可以使用 .Include() 方法来加载相关实体的导航属性。.Include() 方法用于在查询中包含指定的导航属性,以便在查询结果中返回相关联的实体数据。通过使用 .Include() 方法,可以避免延迟加载(lazy loading)导 阅读全文
posted @ 2024-07-09 09:29 龙卷风吹毁停车场 阅读(142) 评论(0) 推荐(0)
摘要: 第一种- 在Fluent API中设置外键 public class Book { /// <summary> /// id /// </summary> public int Id { get; set; } /// <summary> /// 书本名称 /// </summary> public 阅读全文
posted @ 2024-07-07 10:18 龙卷风吹毁停车场 阅读(80) 评论(0) 推荐(0)
摘要: 前言: 真实入手项目的时候如果向 https://www.cnblogs.com/tlfe/p/18284025 中 第5点这么给每个表中的字段配置,不方便后期维护和管理1. 在根目录创建一个EntityConfig文件夹 2. 根据实体类创建一个BookEntityConfig.cs类文件 nam 阅读全文
posted @ 2024-07-05 16:22 龙卷风吹毁停车场 阅读(44) 评论(0) 推荐(0)
上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 44 下一页