上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 16 下一页
快速编写代码:缩减代码+tab键 psvm public static void main(String[] args) {} soutm System.out.println("当前类名.当前方法"); soutv System.out.println("变量名 = " + 变量); soutp Read More
posted @ 2021-03-17 23:43 gygtech Views(180) Comments(0) Diggs(0) Edit
WebRequest方式 封装的方法 using Newtonsoft.Json; using System; using System.Collections.Generic; using System.IO; using System.Net; using System.Text; namesp Read More
posted @ 2021-03-13 16:43 gygtech Views(1924) Comments(0) Diggs(0) Edit
-- 查看表结构 DESC 表名; -- 查看 表 - 字段 - 结构信息 SELECT table_name, column_name, column_comment FROM information_schema.COLUMNS WHERE table_schema = '表所在的库' AND Read More
posted @ 2021-03-09 14:55 gygtech Views(462) Comments(0) Diggs(0) Edit
方式一:自定义【在调试是加载时间过长】 NuGet包: Microsoft.Extensions.DependencyModel Microsoft.Extensions.Options XXX.Common项目下新建文件夹【DependencyInjection】 新建类:RuntimeHelpe Read More
posted @ 2021-03-06 16:57 gygtech Views(794) Comments(0) Diggs(0) Edit
方式一:自定义1 方法类: using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations.Schema; using System.Linq; using System.Linq Read More
posted @ 2021-03-06 15:11 gygtech Views(261) Comments(0) Diggs(0) Edit
Dapper框架 个人的一点体会 尽可能的保证数据库【字段名】和类【属性名】的一致性,不然需要多写很多的代码,说多了都是泪泪泪 如果因为遵循了mysql数据库的建表规则【阿里的规则】,表名字段名带下划线的,使用As方式,其他方式自行探索 Dapper框架 分页模型 using System; usi Read More
posted @ 2021-03-04 17:25 gygtech Views(784) Comments(0) Diggs(0) Edit
概念 异常过滤器是一种可以在 WebAPI 中捕获那些未得到处理的异常的过滤器,要想创建异常过滤器,你需要实现 IExceptionFilter 接口,不过这种方式比较麻烦,更快捷的方法是直接继承 ExceptionFilterAttribute 并重写里面的 OnException() 方法即可, Read More
posted @ 2021-03-04 10:22 gygtech Views(927) Comments(0) Diggs(0) Edit
为什么要引用NewtonsoftJson .net5 内置了一套Json序列化/反序列化方案,默认可以不再依赖,不再支持 Newtonsoft.Json. .net5 System.Text.Json 和 Newtonsoft.Json 使用方法不一致,以及其他的差役建议使用Newtonsoft.J Read More
posted @ 2021-03-02 18:01 gygtech Views(1276) Comments(0) Diggs(0) Edit
命名空间 System.ComponentModel.DataAnnotations 全局模型验证,统一api响应 1、WebApi项目下新建文件夹【Custom】,新建文件夹【Filter】定义类FieldActionFilter using Microsoft.AspNetCore.Mvc; u Read More
posted @ 2021-03-02 14:15 gygtech Views(1277) Comments(0) Diggs(1) Edit
Swagger基础配置 1、非生产环境,不开启Swagger,根据实际需要决定 2、设置项目属性 xml文件地址:当前地址【Test.WebApi.xml】,其他项目地址【..\Test.WebApi\Test.WebApi.xml】 3、修改服务注册、注意修改xml文件名称 public Star Read More
posted @ 2021-03-01 16:03 gygtech Views(1280) Comments(0) Diggs(0) Edit
上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 16 下一页