会员
周边
新闻
博问
闪存
赞助商
YouClaw
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
博客园
首页
新随笔
联系
订阅
管理
上一页
1
···
5
6
7
8
9
10
11
12
13
···
44
下一页
2024年8月4日
启动静态文件中间件
摘要: 在启动项 Program.cs 文件中添加 //app.UseStaticFiles(); // 启动静态文件中间件,默认访问wwwroot app.UseStaticFiles(new StaticFileOptions() { //修改默认访问地址为MyStaticFiles文件 FilePro
阅读全文
posted @ 2024-08-04 17:16 龙卷风吹毁停车场
阅读(24)
评论(0)
推荐(0)
2024年7月15日
在webapi中创建一个jwt token
摘要: 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 龙卷风吹毁停车场
阅读(49)
评论(0)
推荐(0)
2024年7月12日
IOC 内置容器的使用
摘要: //nuget安装: Microsoft.Extensions.DependencyInjection //ServiceCollection的生命周期 //AddTransient 瞬时生命周期,每次创建都是一个全新的实例 //AddSingleton 单列生命周期,同一个类型创建出来的是同一个实
阅读全文
posted @ 2024-07-12 16:41 龙卷风吹毁停车场
阅读(31)
评论(0)
推荐(0)
2024年7月10日
asp.net mvc中数据传递的几种方式
摘要: 2.第二步,要想session正常使用,在启动文件中配置如下 3.第三步,接受数据
阅读全文
posted @ 2024-07-10 09:08 龙卷风吹毁停车场
阅读(25)
评论(0)
推荐(0)
2024年7月9日
EFCore 使用 Include 注意
摘要: 在实体框架Entity Framework Core 中,可以使用 .Include() 方法来加载相关实体的导航属性。.Include() 方法用于在查询中包含指定的导航属性,以便在查询结果中返回相关联的实体数据。通过使用 .Include() 方法,可以避免延迟加载(lazy loading)导
阅读全文
posted @ 2024-07-09 09:29 龙卷风吹毁停车场
阅读(168)
评论(0)
推荐(0)
2024年7月7日
EFCore 设置外键
摘要: 第一种- 在Fluent API中设置外键 public class Book { /// <summary> /// id /// </summary> public int Id { get; set; } /// <summary> /// 书本名称 /// </summary> public
阅读全文
posted @ 2024-07-07 10:18 龙卷风吹毁停车场
阅读(105)
评论(0)
推荐(0)
2024年7月5日
EFCore (Fluent API) 分组配置
摘要: 前言: 真实入手项目的时候如果向 https://www.cnblogs.com/tlfe/p/18284025 中 第5点这么给每个表中的字段配置,不方便后期维护和管理1. 在根目录创建一个EntityConfig文件夹 2. 根据实体类创建一个BookEntityConfig.cs类文件 nam
阅读全文
posted @ 2024-07-05 16:22 龙卷风吹毁停车场
阅读(67)
评论(0)
推荐(0)
2024年7月4日
EFCore 在APS.NET MVC中使用
摘要: 1.创建一个APS.NET MVC项目 2.安装Nuget包 Microsoft.EntityFrameworkCore.Design Microsoft.EntityFrameworkCore.SqlServer Microsoft.EntityFrameworkCore.Tools 3.在Mod
阅读全文
posted @ 2024-07-04 15:57 龙卷风吹毁停车场
阅读(36)
评论(0)
推荐(0)
使用 EFCore简单入门(实体类生成数据库表)
摘要: 1.安装Nuget包 Microsoft.EntityFrameworkCore.SqlServer Microsoft.EntityFrameworkCore.Tools Microsoft.EntityFrameworkCore.Design 2.创建Book,Post两个实体类 public
阅读全文
posted @ 2024-07-04 14:01 龙卷风吹毁停车场
阅读(243)
评论(0)
推荐(0)
2024年7月2日
c# , net 创建树形结构,创建树形节点
摘要: /// <summary> /// 生成树形结构 /// </summary> public void GetTreeNode() { //SqlHelper.GetSqlDataReader是封装的查询数据库语句,可根据自己需求封装 //假设获取所有一级节点 List<Products> prod
阅读全文
posted @ 2024-07-02 16:11 龙卷风吹毁停车场
阅读(65)
评论(0)
推荐(0)
上一页
1
···
5
6
7
8
9
10
11
12
13
···
44
下一页
公告