上一页 1 ··· 10 11 12 13 14 15 16 17 18 ··· 44 下一页
摘要: 设置统一时间返回格式跳转到这片文章: https://www.cnblogs.com/tlfe/p/18225339 阅读全文
posted @ 2024-05-31 22:10 龙卷风吹毁停车场 阅读(23) 评论(0) 推荐(0)
摘要: 安装 nuget:Microsoft.AspNetCore.Mvc.NewtonsoftJsonModel文件下创建的基类: namespace WebApiTest1.Model { public class Class { public long Id { get; set; } public 阅读全文
posted @ 2024-05-31 22:00 龙卷风吹毁停车场 阅读(153) 评论(0) 推荐(0)
摘要: 官网: https://www.donet5.com/home/docunget安装包: SqlSugarCore 1.整体目录结构 2. DbContext.cs文件内容 using SqlSugar; using System.Diagnostics; using System.Reflecti 阅读全文
posted @ 2024-05-31 11:28 龙卷风吹毁停车场 阅读(388) 评论(0) 推荐(0)
摘要: 1. Update-Database xxxx 把数据库回滚到xxx的状态,迁移脚本不动. 2. Remove-m igration 删除最后一次的迁移脚本 3. Script-Migration 生成迁移SQL代码,有了Update-Database 为什么还要生成SQL, 可以生成版本D到版本F 阅读全文
posted @ 2024-05-30 14:14 龙卷风吹毁停车场 阅读(48) 评论(0) 推荐(0)
摘要: 使用 : 注意: 用guid做主键时,不能把主键设置为聚集索引,因为聚集索引是按照顺序保存主键的,因此用guid作为主键性能差 Guid g = Guid.NewGuid(); Console.WritLine(g.ToString()); 阅读全文
posted @ 2024-05-30 13:23 龙卷风吹毁停车场 阅读(30) 评论(0) 推荐(0)
摘要: 安装两个NuGet: Microsoft.EntityFrameworkCore.SqlServer Microsoft.EntityFrameworkCore.Tools 1.创建一个Book.cs文件 using System; using System.Collections.Generic; 阅读全文
posted @ 2024-05-30 10:57 龙卷风吹毁停车场 阅读(117) 评论(0) 推荐(0)
摘要: using System; namespace ConsoleApp1 { public class Program { /* 静态方法 (static): 特点: 1.生命周期,一旦创建--应用结束才会销毁 2.可全局使用 3.效率高 用处: 用户登陆信息,系统配置信息,系统设置,SqlHelpe 阅读全文
posted @ 2024-05-25 11:41 龙卷风吹毁停车场 阅读(71) 评论(0) 推荐(0)
摘要: 创建新项目,选择创建 webapi项目 1. 创建完成后点击 Controllers 文件夹,单机右键,选择添加控制器 2.点击确定3.选择api控制器 4.点击确定 5. 更具自己需求,修改 [Route("api/[controller]")], 我这点改为 [Route("api/[contr 阅读全文
posted @ 2024-05-24 14:55 龙卷风吹毁停车场 阅读(190) 评论(0) 推荐(0)
摘要: 我在appsettings.json中配置了链接数据库的信息,红色标记区域 { "ConnectionStrings": { "connStr": "server=.;database=PerformanceAppraisalDb;uid=sa;pwd=123456" }, "Logging": { 阅读全文
posted @ 2024-05-24 13:56 龙卷风吹毁停车场 阅读(133) 评论(0) 推荐(0)
摘要: 1. 再Program.cs 文件中添加 using WebApplication1.Webapi.Utility.ApiVersions; var builder = WebApplication.CreateBuilder(args); // Add services to the contai 阅读全文
posted @ 2024-05-24 11:54 龙卷风吹毁停车场 阅读(65) 评论(0) 推荐(0)
上一页 1 ··· 10 11 12 13 14 15 16 17 18 ··· 44 下一页