宇宙超能无敌之饼干怪

首页 新随笔 联系 管理
上一页 1 2 3 4 5 6 ··· 19 下一页

2024年8月18日 #

摘要: GET curl -X 'GET' \ 'http://localhost:5294/api/Todos?Status=0&PrePage=10' \ -H 'accept: */*' POST curl -X 'POST' \ 'http://localhost:5294/api/Todos' \ 阅读全文
posted @ 2024-08-18 10:30 lazycookie 阅读(2) 评论(0) 推荐(0) 编辑

2024年8月11日 #

摘要: MainWindow.xaml <!-- 1. 使用一个 `Border` 控件作为最外层容器,设置了紫色背景(#7160E8)和圆角(10)。 --> <Border Background="#7160E8" CornerRadius="10"> <Grid> <!-- 2. 主要布局: - 在 阅读全文
posted @ 2024-08-11 11:22 lazycookie 阅读(13) 评论(0) 推荐(0) 编辑

摘要: 依然使用上面的工程,添加Blazor支持,此部分参考微软文档生成 Windows Presentation Foundation (WPF) Blazor 应用,本小节快速略过。 2.1 编辑工程文件WPFBlazorChat.csproj 在项目文件的顶部,将 SDK 更改为 Microsoft. 阅读全文
posted @ 2024-08-11 11:06 lazycookie 阅读(72) 评论(0) 推荐(0) 编辑

摘要: WPFBlazorChat\RazorViews\Counter.razor <h1>Counter</h1> <p>好开心,你点我了,现在是:<span style="color: red;">@currentCount</span></p> <button class="btn btn-prim 阅读全文
posted @ 2024-08-11 11:03 lazycookie 阅读(8) 评论(0) 推荐(0) 编辑

2024年8月10日 #

摘要: WechatPublicRequest\Program.cs using System.Collections.Specialized; using System.Diagnostics; using System.Web; using Newtonsoft.Json; class Program 阅读全文
posted @ 2024-08-10 19:35 lazycookie 阅读(18) 评论(0) 推荐(0) 编辑

2024年8月7日 #

摘要: D:\Code\asp-vue-new\long.client\src\views\order\index.vue <script setup lang="ts"> import { useOrder } from "@/stores/order" const storeOrder = useOrd 阅读全文
posted @ 2024-08-07 21:45 lazycookie 阅读(5) 评论(0) 推荐(0) 编辑

2024年7月30日 #

摘要: snippets\cpp.json { // Place your snippets for cpp here. Each snippet is defined under a snippet name and has a prefix, body and // description. The p 阅读全文
posted @ 2024-07-30 08:38 lazycookie 阅读(6) 评论(0) 推荐(0) 编辑

摘要: settings.json // Place your key bindings in this file to override the defaultsauto[] [ // terminal // 切换到terminal终端 { "key": "ctrl+,", "command": "wor 阅读全文
posted @ 2024-07-30 08:35 lazycookie 阅读(3) 评论(0) 推荐(0) 编辑

摘要: set ai "自动缩进宽度 set sw=4 set ts=4 "关闭高亮显示 set nohlsearch set is set ignorecase set backspace=indent,eol,start set clipboard=unnamed set number " 设置lead 阅读全文
posted @ 2024-07-30 08:17 lazycookie 阅读(5) 评论(0) 推荐(0) 编辑

2024年7月16日 #

摘要: .Net Core 部署 IIS 一、服务器环境配置 1.1 安装 ASP.NET Core 模块 / 托管捆绑包 ASP.NET Core 不再是由 IIS 工作进程(w3wp.exe)托管,而是使用自托管 Web 服务器(Kestrel)运行,为了能部署在 IIS,必须先安装 AspNetCor 阅读全文
posted @ 2024-07-16 21:19 lazycookie 阅读(29) 评论(0) 推荐(0) 编辑

2024年7月2日 #

摘要: 大写的P键可以实现,这个我没有专门配置过,不知道其他人是不是 阅读全文
posted @ 2024-07-02 11:17 lazycookie 阅读(9) 评论(0) 推荐(0) 编辑

2024年6月29日 #

摘要: Trim()的使用 1. 删除字符串两端的特殊符号: string str = "***This string has special characters***"; char[] trimChars = new char[] { '*', '!' }; string trimmed = str.T 阅读全文
posted @ 2024-06-29 20:33 lazycookie 阅读(7) 评论(0) 推荐(0) 编辑

2024年6月25日 #

摘要: ef-core-multiple-providers-main\Migrations\BoxedSoftware.Postgres\BoxedSoftware.Postgres.csproj <Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <Tar 阅读全文
posted @ 2024-06-25 22:02 lazycookie 阅读(8) 评论(0) 推荐(0) 编辑

2024年6月20日 #

摘要: ef core自定义默认的迁移表的名称 using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Design; namespace Long.EntityFrameworkCore; class MyDesig 阅读全文
posted @ 2024-06-20 21:55 lazycookie 阅读(5) 评论(0) 推荐(0) 编辑

摘要: RDPRemoteLoginPro\RDPRemoteLoginPro.csproj <Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <TargetFramework>net8.0-windows</TargetFramework> <Outpu 阅读全文
posted @ 2024-06-20 21:55 lazycookie 阅读(15) 评论(0) 推荐(0) 编辑

2024年6月14日 #

摘要: MediatR的使用 注册服务 MediatR_Demo\Program.cs // using MediatR; // using MediatR_Demo.Repository.Context; // ... // var builder = WebApplication.CreateBuild 阅读全文
posted @ 2024-06-14 06:33 lazycookie 阅读(8) 评论(0) 推荐(0) 编辑

2024年5月22日 #

摘要: 异常过滤 Middleware过滤异常 API\Middlewares\ExceptionMiddleware.cs using System.Net; using API.Contracts; namespace API.Middlewares; public class ExceptionMid 阅读全文
posted @ 2024-05-22 17:00 lazycookie 阅读(4) 评论(0) 推荐(0) 编辑

2024年5月17日 #

摘要: 如何解决Dereference of a possibly null reference.CS8602 Q1 string value = property.GetValue(obj).ToString().Trim(); 上面的代码,报错如下: Dereference of a possibly 阅读全文
posted @ 2024-05-17 10:53 lazycookie 阅读(120) 评论(0) 推荐(0) 编辑

2024年5月13日 #

摘要: https://learn.microsoft.com/zh-cn/sql/connect/ado-net/sqlclient-troubleshooting-guide?view=sql-server-ver15 阅读全文
posted @ 2024-05-13 21:32 lazycookie 阅读(7) 评论(0) 推荐(0) 编辑

摘要: https://learn.microsoft.com/zh-cn/sql/sql-server/install/configure-the-windows-firewall-to-allow-sql-server-access?view=sql-server-ver16 阅读全文
posted @ 2024-05-13 20:19 lazycookie 阅读(7) 评论(0) 推荐(0) 编辑

2024年5月10日 #

摘要: WebAPI.Jwt.Swagger.Final\Long.EntityFrameworkCore\ApplicationDbContext.cs using Microsoft.AspNetCore.Identity; using Microsoft.AspNetCore.Identity.Ent 阅读全文
posted @ 2024-05-10 11:16 lazycookie 阅读(40) 评论(0) 推荐(0) 编辑

2024年5月8日 #

摘要: 日志级别学习 // Trace:0,包含最详细的消息。 这些消息可能包含敏感的应用数据。 // Debug:1,用于调试和开发。 // Information:2,一般用于跟踪系统的日志。 // Warning:3,一般用于记录异常事件或意外事件。 // Error:4,一般用于记录无法处理的异常。 阅读全文
posted @ 2024-05-08 23:26 lazycookie 阅读(15) 评论(0) 推荐(0) 编辑

2024年5月3日 #

摘要: 1、添加审核日志实体 1.1 实体定义 在项目 Electric.Entity,添加文件夹:AuditLogs,并添加类:EleAuditLog。 EleAuditLog 完整代码如下: namespace Electric.Entity.AuditLogs; /// <summary> /// 审 阅读全文
posted @ 2024-05-03 16:26 lazycookie 阅读(15) 评论(0) 推荐(0) 编辑

2024年5月2日 #

摘要: 一、ILogger 介绍 1.1 简介 ILogger 是. NET 框架提供的一个接口,用于统一不同日志库的调用方式。ILogger 本身并不提供具体的日志记录功能,而是通过实现它的类来执行这些操作。 所以我们可以借助第三方日志库或自定义实现 ILoggerProvider,将日志消息写入到文件、 阅读全文
posted @ 2024-05-02 19:41 lazycookie 阅读(114) 评论(0) 推荐(0) 编辑

2024年4月30日 #

摘要: 一、工作单元事务代码分析 在上一个课程,我们已经实现了数据库事务功能,来保证数据的完整性。 通过上一个课程的实现方式,我们在每一个 Action 开头和结尾,都需要添加对应的代码,才能实现事务功能,具体见以下截图: 这种实现方式存在以下 2 个问题: 在具体业务开发中,一个请求往往都会涉及多次数据库 阅读全文
posted @ 2024-04-30 16:46 lazycookie 阅读(7) 评论(0) 推荐(0) 编辑

摘要: 项目结构重构 1.1 Electric.DbMigrator 存在的问题 我们先来看下,后台 API 项目的目录结构。 其中 Electric.DbMigrator,这个项目作用是用来做数据库迁移的,但是同时也会被其他项目引用,还有这个项目类型还是 Web API 类型的。所以存在以下的几个问题: 阅读全文
posted @ 2024-04-30 14:39 lazycookie 阅读(9) 评论(0) 推荐(0) 编辑

2024年4月28日 #

摘要: Entity Framework Core (EF Core) 执行原生 SQL 查询 需要返回查询结果 使用 FromSqlRaw() 方法:这是 EF Core 提供的一种执行原生 SQL 查询的方式。您可以将 SQL 查询直接嵌入到代码中,并将结果作为实体对象返回。以下是一个示例,演示如何执行 阅读全文
posted @ 2024-04-28 17:27 lazycookie 阅读(221) 评论(0) 推荐(0) 编辑

摘要: Console.Config\Program.cs using Microsoft.Extensions.Configuration; var basePath = Directory.GetCurrentDirectory(); var configuration = new Configura 阅读全文
posted @ 2024-04-28 16:48 lazycookie 阅读(20) 评论(0) 推荐(0) 编辑

摘要: dotnet的console应用如何使用配置文件 Console.Config\Program.cs using Microsoft.Extensions.Configuration; var basePath = Directory.GetCurrentDirectory(); var confi 阅读全文
posted @ 2024-04-28 16:15 lazycookie 阅读(9) 评论(0) 推荐(0) 编辑

2024年4月27日 #

摘要: dotnet-6-basic-authentication-api/Entities/User.cs namespace WebApi.Entities; using System.Text.Json.Serialization; public class User { public int Id 阅读全文
posted @ 2024-04-27 21:10 lazycookie 阅读(16) 评论(0) 推荐(0) 编辑

摘要: middleware的编写和注册 编写中间件类(middleware-class) 通常,中间件封装在类中,并且通过扩展方法公开。 具有类型为 RequestDelegate 的参数的公共构造函数。 public LoggingMiddleware(RequestDelegate next) { _ 阅读全文
posted @ 2024-04-27 20:56 lazycookie 阅读(10) 评论(0) 推荐(0) 编辑

2024年4月25日 #

摘要: JSON序列化属性名由大写变成小写的问题 在 ASP.NET 中,默认情况下,JSON 序列化会将属性名转换为小写(camel case)以匹配 JSON 的约定。 如果您希望保留 C# 的命名约定(即属性名的大小写不变),您需要更改默认的 JSON 序列化器。 System.Text.Json 使 阅读全文
posted @ 2024-04-25 16:23 lazycookie 阅读(299) 评论(0) 推荐(0) 编辑

摘要: 数据库的设计 实体之间的关系图 实体 EleOrderRowItem.cs public class EleOrderRowItem : EleEntity { public string? Xxx { get; set; } // 外键:一个rowItem属于一个row public long R 阅读全文
posted @ 2024-04-25 12:06 lazycookie 阅读(8) 评论(0) 推荐(0) 编辑

摘要: 在 EF Core 中,如果查询查询外键表的内容 实体 public class Blog { public int BlogId { get; set; } public string Url { get; set; } public List<Post> Posts { get; set; } 阅读全文
posted @ 2024-04-25 11:47 lazycookie 阅读(224) 评论(0) 推荐(0) 编辑

2024年4月21日 #

摘要: 问题 [Route("api/[controller]")] [ApiController] public class UserController : ControllerBase { private readonly UserManager<IdentityUser> _userManager; 阅读全文
posted @ 2024-04-21 21:45 lazycookie 阅读(14) 评论(0) 推荐(0) 编辑

2024年4月16日 #

摘要: 获取当前程序所在的目录 // 获取当前程序的执行目录信息 Console.WriteLine(AppDomain.CurrentDomain.BaseDirectory); // asp.net使用,不过在console下也是 /xxx/bin/Debug/net8.0/ Console.Write 阅读全文
posted @ 2024-04-16 22:57 lazycookie 阅读(29) 评论(0) 推荐(0) 编辑

摘要: // 获取文件夹中后缀是txt的文件 string directoryPath = @"/Users/Code/Wechat.Crawler/Links"; string[] filePaths = Directory.GetFiles(directoryPath, "*.txt"); // 获取文 阅读全文
posted @ 2024-04-16 21:10 lazycookie 阅读(65) 评论(0) 推荐(0) 编辑

2024年4月15日 #

摘要: Wechat.Crawler/App/App.csproj <Project Sdk="Microsoft.NET.Sdk"> <ItemGroup> <ProjectReference Include="..\Blog\Blog.csproj" /> </ItemGroup> <ItemGrou 阅读全文
posted @ 2024-04-15 22:38 lazycookie 阅读(31) 评论(0) 推荐(0) 编辑

2024年4月12日 #

摘要: vsvim的配置 set ai "自动缩进宽度 set sw=4 set ts=4 "关闭高亮显示 set nohlsearch set is set ignorecase set backspace=indent,eol,start set clipboard=unnamed set number 阅读全文
posted @ 2024-04-12 13:46 lazycookie 阅读(178) 评论(0) 推荐(0) 编辑

2024年4月10日 #

摘要: set ai "自动缩进宽度 set sw=4 set ts=4 "关闭高亮显示 set nohlsearch set is set ignorecase set backspace=indent,eol,start set clipboard=unnamed set number "Set <LE 阅读全文
posted @ 2024-04-10 20:09 lazycookie 阅读(27) 评论(0) 推荐(0) 编辑

上一页 1 2 3 4 5 6 ··· 19 下一页