上一页 1 ··· 4 5 6 7 8 9 下一页
摘要: ##Startup 在Startup的ConfigureServices()中配置DI的接口与其实现 public void ConfigureServices(IServiceCollection services) { #region 配置依赖注入 services.AddScoped(type 阅读全文
posted @ 2021-01-18 15:25 sorachannel 阅读(230) 评论(0) 推荐(0)
摘要: 手上有一个以前项目用到的.NET工具类封装的DLL。 正好又想试一下动态LAMBDA表达式,用.NET Reflector看一下源码。 public static class ExpressionExtension { public static Expression<Func<TSource, b 阅读全文
posted @ 2021-01-18 11:28 sorachannel 阅读(122) 评论(0) 推荐(0)
摘要: #前言 继承ExceptionFilterAttribute后,重写OnException函数。 统一捕捉所有报错,格式化返回前端。 #代码实现 ##基类控制器 在基类控制器上添加[ErrorCatch]特性: (.NetCore3中没有JsonResult,从使用习惯出发,使用自己写的JsonCo 阅读全文
posted @ 2021-01-18 09:16 sorachannel 阅读(118) 评论(0) 推荐(0)
摘要: 变量默认值 常用值类型变量的默认值 boolean: false string: "" int: 0 uint: 0 enum: 枚举中的第一个元素 address: 0x0000000000000000000000000000000000000000 (或 address(0)) function 阅读全文
posted @ 2021-01-15 11:25 sorachannel 阅读(1026) 评论(0) 推荐(0)
摘要: 数组 创建数组的规则 // 1. 创建数组的规则 contract MyContract { // 定长数组 动态数组 string[10] public arr1; int256[] public arr2; bytes public arr3; bytes1[] public arr4; fun 阅读全文
posted @ 2021-01-14 17:05 sorachannel 阅读(119) 评论(0) 推荐(1)
上一页 1 ··· 4 5 6 7 8 9 下一页