自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(69)
  • 收藏
  • 关注

原创 PostgreSql 跨库查询 &a column definition list is required for functions returning “record”

跨库查询SQL 错误 [42601]: ERROR: a column definition list is required for functions returning “record”SQL 错误 [42804]: ERROR: remote query result rowtype does not match the specified FROM clause rowtype

2024-05-14 13:58:21 160

原创 通过C#获取Windows设置的夏令时开关

通过C#获取Windows设置的夏令时开关

2023-11-30 16:14:50 545

原创 C# List 复制之深浅拷贝

C# List 复制 深拷贝 浅拷贝

2023-09-27 16:01:39 1870

原创 Postgre安装完成后,postgresql 的windows服务启动失败解决办法

postgresql 服务无法正常启动的解决办法

2023-03-08 16:29:52 3013

原创 Postgre The database operation was expected to affect 1 row(s), but actually affected 0 row

Postgre , The database operation was expected to affect 1 row(s), but actually affected 0 row

2023-03-08 16:07:16 1076

原创 Requires a primary key to be defined. If you intended to use a keyless entity type, call ‘HasNoKey‘

requires a primary key to be defined. If you intended to use a keyless entity type, call 'HasNoKey' in 'OnModelCreating'

2022-11-30 09:54:46 1530

原创 Web 报错 状态码302

Web 报错 状态码302

2022-07-29 00:29:32 8656

原创 ABP 删除数据 发生异常 data may have been modified or deleted since entities were loaded

ABP 删除数据 发生异常 data may have been modified or deleted since entities were loaded

2022-07-29 00:09:20 726

原创 VS 2022 启动ApiHost 时提示 无法连接到web服务器 IIS Express

VS 2022 提示 无法连接到web服务器 IIS Express

2022-07-23 09:29:15 2168

原创 mysql 通过mysqldump指定条件备份sql

mysql 通过mysqldump指定条件备份sql

2022-07-19 23:32:50 820

原创 PGSQL更新 json 字符串内容

PostGreSql 更新json 字符串的内容和添加字段

2022-07-19 08:56:50 988

原创 ABP 报错 DenyAnonymousAuthorizationRequirement: Requires an authenticated user.

Authorization failed. These requirements were not met:DenyAnonymousAuthorizationRequirement: Requires an authenticated user."code": "Volo.Authorization:010001"

2022-05-14 00:05:23 1551 2

原创 Minio中文路径造成无法下载问题解决办法

Minio中文路径造成无法下载问题.net core解决办法//后端需要对含有中文的路径进行加密 var encodedFilePath= Encoding.UTF8.GetString(Convert.FromBase64String(filePath));var lastFilePath = HttpUtility.UrlDecode(encodedFilePath);// 前端使用TS, 对url 进行编码encodeURIComponent(imagePath)...

2022-05-06 12:17:55 2199

原创 C# Except comparer 使用小结

C# list Except Comparer

2022-03-07 10:56:37 1189

原创 C# 依赖dll 嵌在exe内

C# 依赖dll 嵌在exe内

2022-02-17 16:10:43 792

原创 Dicom 中文乱码问题解决方案

DICOM 中文乱码问题解决方案

2022-01-15 14:32:34 3111

原创 Dicom 私有Tag 的定义

Dicom 私有Tag 的定义

2022-01-12 10:39:15 388

原创 IIS 简单站点发布

1.进入IIS 管理器,先进行添加网站2.

2021-12-30 18:09:27 534

原创 C# 矩阵运算求逆 转置

static void Main(string[] args){double[,] matrix = new double[4,4]{{ 1, 0, 0, 0 },{ 0, 1, 0, 0 },{ 0, 0, 1, 0 },{ -139, -163, 0.9, 1 },}; var str = "1,0,0,0,0,1,0,0,0,0,1,0,-139,-163,0.9,1"; var matrix1 = ConvertStringToTwoArray(str

2021-11-23 10:26:35 327

原创 安装了windows 服务,在服务列表里找不到服务的解决办法

安装了windows 服务,在服务列表里找不到服务的解决办法当我们安装了windows 服务,一般在任务管理器中的服务或者是服务界面是可以看到相应的服务的今天遇到服务安装了,但是在服务列表中却找不到该服务的现象,服务重装了,电脑也重启了,依然是显示不了,尝试在cmd 窗口重启该服务在 CMD 窗口中重启该服务// 重启服务net start ServiceName发现该服务已经启动了在 CMD 窗口中查找该服务// 查找服务sc query |findstr "ServiceName"

2021-09-13 11:16:38 5727 1

原创 .net core 一对一的表 建立

.net core 一对一的表 建立分别在两张表内建立导航属性和关联ID//ResumeEntity public class ResumeEntity: AuditedAggregateRoot<Guid> { public string Education { get; set; } public string StaffId { get; set;

2021-09-11 15:28:38 203

原创 ’abp‘不是内部或外部命令,也不是可运行的程序 或批处理文件的解决办法

’abp‘不是内部或外部命令,也不是可运行的程序 或批处理文件这种问题 是老生常谈的问题啦,一般是环境变量没有设置在装好dotnet 后,安装Abp.Clidotnet tool install -g Volo.Abp.Cli如果已经装好,需要更新的话执行dotnet tool update -g Volo.Abp.Cli完成安装后,把对应的安装路径放到环境变量中C:\Users\uername.dotnet\tools在cmd 窗口输入abp ,可以看到版本信息啦...

2021-09-10 18:03:53 1582

原创 C# List AddRange Concat Value cannot be null. (Parameter ‘collection‘)

C# List AddRange Concat Value cannot be null. (Parameter ‘collection’)在C# 中两个list进行相加时,经常用到List.AddRange() 或则Concat()的用法如果使用时遇到 Value cannot be null. (Parameter ‘collection’)的异常,说明被添加的list 对象是null有关AddRange 的说明有关Concat 的说明想要避免这个问题,2种解决办法使用AddRang

2021-08-20 10:16:34 1260

原创 解决URL 中出现%E2%80%8E

解决URL 中出现%E2%80%8E调用第三方接口时,从内部WIKI 上复制了URL 的地址,直接帖在VS2019 中去使用调试时发现无法获取数据,报404查看拼接的URL是ok的,此时在VS中是看不出来有空格存在的, 通过Swagger 获取数据也是OK 的,尝试把URL 直接放在浏览器里去执行,发现URL 解析出来包含”%E2%80%8E“,尝试找解决方案,把“%E2%80%8E”过滤具体方案如下:通过string.Replace()对“%E2%80%8E” 进行过滤把有问题的URL

2021-08-17 16:00:55 3024

原创 ABP There is already an object named ‘AbpAuditLogs‘ in the database

There is already an object named ‘AbpAuditLogs’ in the database在使用ABP做demo 时,生成数据库时,会提示AbpAuditLogs 已经存在此时去数据库查看数据库的数据,发现找不到相应的数据表数据库连接字符串如下:和数据库引用如下:依赖包如下:可以发现我们使用的数据库是SqlServer,由于我本地没有安装SqlServer,用的一直都是PostgreSql, 一直再用PostgreSql 来查询表,所以以为本地删除了,其

2021-08-16 20:02:35 1028

原创 git 保证历史记录 图形 主线清爽,便于分支维护的做法

保证历史记录 图形 主线清爽,便于分支维护的做法// 1 将本地更改内容放到暂存区 git stash// 1-1 查看暂存区更改内容 git stash list // 2 从本地开发分支 切到本地Dev 分支 git checkout Dev // 3 拉取Dev最新内容 git pull // 4 查看拉取的内容是否为最新 gitk// 5 创建本地分支 branchFolder/newbranch git check-out -b branchFolder/newbr

2021-07-29 18:01:57 178

原创 C# string.Format常见异常

C# string.Format常见异常Index (zero based) must be greater than or equal to zero and less than the size of the argument list.

2021-07-28 17:06:09 967

原创 Tag being set does not match tag in DicomElement

Tag being set does not match tag in DicomElement在处理Dicom 文件时,经常需要构建DicomSequenceItem ,此时要保证DicomElementSq的对象和DicomSequenceItem 一致,否则会在运行时发生异常// 遇到的异常写法 var wedgesSq = new DicomElementSq(DicomTags.WedgeSequence); sequenceItem[DicomTags.RecordedWedgeS

2021-07-28 15:59:39 55

原创 C# string 和 list contains 使用注意事项

C# string 和 list contains 使用注意事项string 使用containslist 使用containsstring 使用contains string testStr = string.Empty; //此时调用contains 判断是否含有字符串 是没问题的,result 为false var result = testStr.Contains("test"); //此时调用contains 判断是否含有字符 也是没问题的,result 为false res

2021-07-18 14:20:53 1963

原创 Index (zero based) must be greater than or equal to zero and less than the size of the argument list

Index (zero based) must be greater than or equal to zero and less than the size of the argument list.在coding 时,遇到了以上错误信息,检查了代码,不出来问题经调试后发现是以下写法导致,// 经常用到string.formatvar ret = string.Format("{0}{1}{2}{3}", "test", "test1", "test2");定义4个变量,实际赋值3个该写法

2021-06-29 10:21:21 6550

原创 C# string转enum的泛型转换方法

C# string转enum的泛型转换方法开发中常用到string 到枚举的转换,写了个泛型转换demo// demo internal class Program { static void Main(string[] args) { Console.WriteLine("Hello World!"); var ret = StringToEnum<Color>("Red");

2021-06-17 11:34:28 565

原创 .net core add-migration requires a primary key to be defined

The entity type ‘BeamLimitingDeviceTolerance’ requires a primary key to be defined. If you intended to use a keyless entity type, call ‘HasNoKey’ in ‘OnModelCreating’. For more information on keyless entity types, see https://go.microsoft.com/fwlink/?linki

2021-06-17 00:03:54 1357

原创 C# LINQ to Entities 不识别方法

C# Entity使用LINQ的注意事项// 使用LINQ 查询var dbStudent = _dbWrapper.GetEntities<tablestudent>().LastOrDefault(item => item.grade != null && item.grade == 80);此时会报出以下异常"LINQ to Entities 不识别方法“原因是对集合的查询操作会被LINQ编译成SQL语句,此时是无法识别方法的。可以通过以下方式来解决/

2021-06-05 10:57:31 696

原创 RabbitMQ 如何确保消息传递的准确性?

RabbitMQ 如何确保消息传递的准确性?这里的autoAck参数指的是是否自动确认,如果设置为ture,RabbitMQ会自动把发送出去的消息置为确认,然后从内存(或者磁盘)中删除,而不管消费者接收到消息是否处理成功;如果设置为false,RabbitMQ会等待消费者显式的回复确认信号后才会从内存(或者磁盘)中删除。建议将autoAck设置为false,这样消费者就有足够的时间处理消息,不用担心处理消息过程中消费者宕机造成消息丢失。此时,队列里的消息就分成了2个部分:等待投递给消费者的消息(下图

2021-06-03 20:19:45 295

原创 .net 5 Map 使用注意事项

.net中Map 使用注意事项在Application 层可以做对象和Entity 的Map,以下是ApplicationService中的定义以下是接口IObjectMapper的定义// A code blockvar result = ObjectMapper.Map<Entity, Dto>(Entity); var result = ObjectMapper.Map<List<Entity>, List<Dto>>(Entities

2021-06-03 20:10:31 748

原创 Dicom中日期和时间的解析处理

Dicom中日期和时间的解析处理在Dicom 中存储的是05/06/2021, 15:00:38.000000存入数据库中发现时间变为是导入Dicom 数据时,解析时间错误,原来的实现如下: string reviewTimeStr;//会变成 if (DataSet[DicomTags.ReviewTime].TryGetString(0, out reviewTimeStr)) { TimeSpan reviewTime; if (TimeSpan.

2021-05-19 13:07:26 971

原创 C# string 对象 ToUpper() Equals()的使用注意事项

C# string 对象 ToUpper的使用注意事项string特性ToUpper 使用时需要判空操作string特性编译器直接支持的类型:sbyte / byte / short / ushort / int / uint / long / ulongchar / float / double / bool / decimal /object / stringstring 是基元类型的一种,null 字符串:没有分配内存;空字符串分配了内存,但内存里面没有数据.//null 字符串str

2021-05-13 18:05:19 408

原创 Mysql触发器

Mysql触发器触发器原理触发器使用场景触发器原理触发器使用场景代码层面可以实现,如果是CS 或者BS 架构, 会有不同的用户在操作数据库,无法保证数据的准确性

2021-05-07 10:29:10 63

原创 C# 常量 const readonly与static readonly用法与区别

C# 常量 const readonly与static readonly用法与区别const 静态常量readonly 动态常量// A code blockpublic class ConstClass { private readonly int A = 32; private const int B = 33; public readonly int C = 34; public static readonly int

2021-05-06 17:45:40 172

原创 C# 大于 DateTime.MaxValue 或小于 DateTime.MinValue 的 DateTime 值无法序列化

在转换为 UTC 时,大于 DateTime.MaxValue 或小于 DateTime.MinValue 的 DateTime 值无法序列化为 JSOpublic string Serialize(object obj){DataContractJsonSerializer serializer = new DataContractJsonSerializer(typeof(T)); using (MemoryStream ms = new MemoryStream())

2021-04-25 17:26:03 1051

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除