怪物奇妙物语

宇宙无敌超级美少男的怪物奇妙物语

首页 新随笔 联系 管理
  819 随笔 :: 0 文章 :: 2 评论 :: 16万 阅读
上一页 1 2 3 4 5 6 7 ··· 21 下一页

2024年9月1日 #

摘要: # DemoNormal\Demo.DI\Demo.DI.csproj <Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <OutputType>Exe</OutputType> <TargetFramework>net8.0</TargetFram 阅读全文
posted @ 2024-09-01 17:43 超级无敌美少男战士 阅读(6) 评论(0) 推荐(0) 编辑

2024年8月31日 #

摘要: new 关键字、隐藏基类方法 new 关键字还可以用来隐藏基类中的方法。 当子类的方法名称与基类中的方法名称相同,但不希望子类的方法被视为重写(override)基类的方法时,可以使用 new 关键字来声明子类的方法, 从而隐藏基类的方法。 代码示例 public class BaseClass { 阅读全文
posted @ 2024-08-31 12:47 超级无敌美少男战士 阅读(11) 评论(0) 推荐(0) 编辑

摘要: 泛型中的new关键字的约束的函数 一般用于泛型约束,在函数或者类的末尾,通过 where T : new() 约束,确保 T 类型可以被实例化。 应用场景 在封装sqlsugar中我遇到了类似的用法,传给sqlsugar中的entity必须有一个公开的无参构造函数 👇👇👇👇👇👇 publ 阅读全文
posted @ 2024-08-31 12:46 超级无敌美少男战士 阅读(6) 评论(0) 推荐(0) 编辑

摘要: # 委托类型 事件触发 回调函数 按钮事件 DelegateButton\DelegateButton.csproj <Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <OutputType>Exe</OutputType> <TargetFrame 阅读全文
posted @ 2024-08-31 11:57 超级无敌美少男战士 阅读(8) 评论(0) 推荐(0) 编辑

摘要: # 委托类型 函数别名 DeleGate\Program.cs using System; class Program { // 定义一个委托类型 public delegate void OperationDelegate(int x, int y); public static void Add 阅读全文
posted @ 2024-08-31 11:56 超级无敌美少男战士 阅读(5) 评论(0) 推荐(0) 编辑

摘要: LearnPlayground\PubSub\Program.cs using System; // 定义一个委托类型 public delegate void MyDelegate(string message); public class Publisher { // 定义一个事件,使用前面定义 阅读全文
posted @ 2024-08-31 09:55 超级无敌美少男战士 阅读(10) 评论(0) 推荐(0) 编辑

2024年8月30日 #

摘要: PlayGround\.config\dotnet-tools.json { "version": 1, "isRoot": true, "tools": { "csharpier": { "version": "0.29.1", "commands": [ "dotnet-csharpier" ] 阅读全文
posted @ 2024-08-30 20:58 超级无敌美少男战士 阅读(32) 评论(0) 推荐(0) 编辑

2024年8月29日 #

摘要: 复制配置文件到输出文件夹 <ItemGroup> <None Update="appsettings.json"> <CopyToOutputDirectory>Always</CopyToOutputDirectory> </None> <None Update="nlog.config" Cop 阅读全文
posted @ 2024-08-29 21:56 超级无敌美少男战士 阅读(23) 评论(0) 推荐(0) 编辑

摘要: # PlayGround\.config\dotnet-tools.json { "version": 1, "isRoot": true, "tools": { "csharpier": { "version": "0.29.1", "commands": [ "dotnet-csharpier" 阅读全文
posted @ 2024-08-29 21:52 超级无敌美少男战士 阅读(79) 评论(0) 推荐(0) 编辑

摘要: lock 为什么要传入一个object对象 public class Singleton { public static Singleton instance; public static readonly object singletonLock = new object(); private S 阅读全文
posted @ 2024-08-29 19:24 超级无敌美少男战士 阅读(17) 评论(0) 推荐(0) 编辑

摘要: dotnet如何设置restore package path,依赖和项目放在一起 配置说明 再.csproj中添加如下配置,然后 dotnet restore ,可以依赖包放到和项目一起,从而方便移动到没有网络的电脑上执行 <RestorePackagesPath>../packages</Rest 阅读全文
posted @ 2024-08-29 19:23 超级无敌美少男战士 阅读(69) 评论(0) 推荐(0) 编辑

摘要: using System.Linq.Expressions; using Microsoft.Extensions.Configuration; using SqlSugar; namespace SqlSugarFrameworkCore; public class DbSettings { pu 阅读全文
posted @ 2024-08-29 19:23 超级无敌美少男战士 阅读(46) 评论(0) 推荐(0) 编辑

摘要: 如何创建dotnet-tools的配置文件 dotnet new tool-manifest dotnet tool install csharpier .csharpierrc.json { "printWidth": 100, "useTabs": false, "tabWidth": 4, " 阅读全文
posted @ 2024-08-29 19:22 超级无敌美少男战士 阅读(9) 评论(0) 推荐(0) 编辑

2024年8月28日 #

摘要: ** 能用 foreach 遍历访问的对象需要实现 什么 接口或声明 什么 方法** 要使用 foreach 循环,对象必须实现 I Enumerable 接口或者声明 Get Enumerator 方法。 解释 IEnumerable 接口:这个接口定义了一个名为 GetEnumerator 的方 阅读全文
posted @ 2024-08-28 19:29 超级无敌美少男战士 阅读(17) 评论(0) 推荐(0) 编辑

摘要: 单例模式 单例模式 public class Singleton { // 定义一个静态变量来保存类的实例 private static Singleton uniqueInstance; // 定义一个标识确保线程同步 private static readonly object locker = 阅读全文
posted @ 2024-08-28 19:14 超级无敌美少男战士 阅读(80) 评论(0) 推荐(0) 编辑

2024年8月27日 #

摘要: 任务和线程的区别 在我们了解 Task 之前,如果我们要使用多核的功能可能就会自己来开线程,然而这种线程模型在. net 4.0 之后被一种称为基于“任务的编程模型” 所冲击,因为 task 会比 thread 具有更小的性能开销,不过大家肯定会有疑惑,任务和线程到底有什么区别? 1:任务是架构在线 阅读全文
posted @ 2024-08-27 23:10 超级无敌美少男战士 阅读(4) 评论(0) 推荐(0) 编辑

2024年8月21日 #

摘要: 如何通过efcore生成实体模型 To create an Entity Data Model from the database using the Database First approach in EF Core, we’ll follow these steps: Create a new 阅读全文
posted @ 2024-08-21 07:49 超级无敌美少男战士 阅读(19) 评论(0) 推荐(0) 编辑

摘要: Entity Framework Core with Existing Database 数据库长这样: Scaffold-DbContext Command 说明 Use Scaffold-DbContext to create a model based on your existing dat 阅读全文
posted @ 2024-08-21 07:44 超级无敌美少男战士 阅读(80) 评论(0) 推荐(0) 编辑

2024年8月19日 #

摘要: CSharpier 配置 .csharpierrc.json { "printWidth": 100, "useTabs": false, "tabWidth": 4, "endOfLine": "auto" } 参数说明 Print Width​ Specify at what point the 阅读全文
posted @ 2024-08-19 21:07 超级无敌美少男战士 阅读(42) 评论(0) 推荐(0) 编辑

2024年8月18日 #

摘要: LinqExpressionLearn\Linq\ParameterRebinder.cs using System.Linq.Expressions; /// <summary> /// 表达式参数 /// </summary> public class ParameterRebinder : E 阅读全文
posted @ 2024-08-18 17:12 超级无敌美少男战士 阅读(4) 评论(0) 推荐(0) 编辑

摘要: 封装前和封装后的实体类设计 如何封装 封装前的例子 假设我们有一个用户实体类 User,在封装前,可能看起来像这样: public class User { public int Id { get; set; } public string UserName { get; set; } public 阅读全文
posted @ 2024-08-18 15:44 超级无敌美少男战士 阅读(10) 评论(0) 推荐(0) 编辑

摘要: curlRequest\json\createtodo.json { "name": "eat", "status": 0, "remark": "eat apple" } curlRequest\json\createtodo2.json { "name": "eat", "status": 0, 阅读全文
posted @ 2024-08-18 10:38 超级无敌美少男战士 阅读(10) 评论(0) 推荐(0) 编辑

摘要: 获取最新的shell脚本并执行 #!/bin/bash # 获取当前目录 current_dir=$(pwd) # 获取当前脚本的绝对路径 script_path=$(readlink -f "$0") # 使用find查找以temp开头且以.sh结尾的文件,并按修改时间排序 latest_file 阅读全文
posted @ 2024-08-18 10:32 超级无敌美少男战士 阅读(82) 评论(0) 推荐(0) 编辑

摘要: 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 超级无敌美少男战士 阅读(5) 评论(0) 推荐(0) 编辑

2024年8月11日 #

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

摘要: 依然使用上面的工程,添加Blazor支持,此部分参考微软文档生成 Windows Presentation Foundation (WPF) Blazor 应用,本小节快速略过。 2.1 编辑工程文件WPFBlazorChat.csproj 在项目文件的顶部,将 SDK 更改为 Microsoft. 阅读全文
posted @ 2024-08-11 11:06 超级无敌美少男战士 阅读(273) 评论(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 超级无敌美少男战士 阅读(29) 评论(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 超级无敌美少男战士 阅读(50) 评论(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 超级无敌美少男战士 阅读(7) 评论(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 超级无敌美少男战士 阅读(9) 评论(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 超级无敌美少男战士 阅读(8) 评论(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 超级无敌美少男战士 阅读(9) 评论(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 超级无敌美少男战士 阅读(199) 评论(0) 推荐(0) 编辑

2024年7月2日 #

摘要: 大写的P键可以实现,这个我没有专门配置过,不知道其他人是不是 阅读全文
posted @ 2024-07-02 11:17 超级无敌美少男战士 阅读(19) 评论(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 超级无敌美少男战士 阅读(21) 评论(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 超级无敌美少男战士 阅读(11) 评论(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 超级无敌美少男战士 阅读(13) 评论(0) 推荐(0) 编辑

摘要: RDPRemoteLoginPro\RDPRemoteLoginPro.csproj <Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <TargetFramework>net8.0-windows</TargetFramework> <Outpu 阅读全文
posted @ 2024-06-20 21:55 超级无敌美少男战士 阅读(35) 评论(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 超级无敌美少男战士 阅读(19) 评论(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 超级无敌美少男战士 阅读(7) 评论(0) 推荐(0) 编辑

上一页 1 2 3 4 5 6 7 ··· 21 下一页
点击右上角即可分享
微信分享提示