随笔分类 -  .net core

摘要:1. 原理 乐观并发的原理: update GoodsInfo set goodOwner=新值 where id=01 and goodOwner=旧值 剖析:当Update的时候,如果数据库中的goodOwner值已经被其他操作者更新为其他值了,那么where语句的值就会为false,因此这个U 阅读全文
posted @ 2023-06-06 20:02 .net&new 阅读(223) 评论(0) 推荐(0) 编辑
摘要:var container = new MyContainer(); container.RegisterType<ILanguage, Chinese>(); //使用别名注册 container.RegisterType<ILanguage, Englisth>("english"); var 阅读全文
posted @ 2023-05-24 22:23 .net&new 阅读(11) 评论(0) 推荐(0) 编辑
摘要:性能调优——EFCore调优 按下硬件、网络不提,我们单表从程序层面对系统的性能进行优化,翻来覆去无外乎三个方面 缓存 异步 sql本片文章,我们针对.net core web项目的ef core框架进行性能优化。 1. EF Core框架已经本地缓存机制memorycache,所以我们访问一个接口 阅读全文
posted @ 2023-04-29 08:45 .net&new 阅读(275) 评论(0) 推荐(0) 编辑
摘要:using Microsoft.AspNetCore.Mvc;using RestSharp;using System.Net;using System.Text;using Newtonsoft.Json; public string Fed_GetAccessToken() { //grant_ 阅读全文
posted @ 2022-10-17 21:26 .net&new 阅读(158) 评论(0) 推荐(0) 编辑
摘要:直到ASP.NET Core 1.0 RC1: 它是System.Security.Claims命名空间中的User.GetUserId(). 自ASP.NET Core 1.0 RC2: 您现在必须使用UserManager.您可以创建一个方法来获取当前用户: private Task<Appli 阅读全文
posted @ 2022-10-15 12:45 .net&new 阅读(664) 评论(0) 推荐(0) 编辑
摘要:定义 Excel专用特性名 (应用导出表格列名) 引入Nuget包 1.Microsoft.AspNetCore.Hosting 2.DotNetCore.NPOI 引入包 using NPOI.SS.UserModel;using NPOI.XSSF.UserModel;using System. 阅读全文
posted @ 2022-10-15 12:42 .net&new 阅读(224) 评论(0) 推荐(0) 编辑
摘要://如果类库是Service var Services = Assembly.Load("Service").GetTypes().Where(w => w.Name.Contains("Service"));foreach (var item in Services){ var name = it 阅读全文
posted @ 2022-10-13 21:30 .net&new 阅读(12) 评论(0) 推荐(0) 编辑
摘要:这里说下,SDK 和 RunTime 的区别:1、SDK 是用来开发 NetCore 的,内部捆绑了 Runtime 运行时;2、但是如果只想运行 NetCore 项目的话,只需要在服务器中安装 Runtime 运行时即可; 怎么判断安装成功了呢?直接运行命令,如果有结果证明成功了: 阅读全文
posted @ 2022-09-15 21:54 .net&new 阅读(693) 评论(0) 推荐(0) 编辑
摘要:Swagger是我们的好朋友,让后端不用再写文档(当然文档该写的还得写) 但是更方便我们对自己接口的测试,推荐使用Swagger 进行接口文档管理 这里简单介绍比较常用的的点,一定要提官方文档https://docs.microsoft.com/zh-cn/aspnet/core/tutorials 阅读全文
posted @ 2022-09-14 20:47 .net&new 阅读(65) 评论(0) 推荐(0) 编辑
摘要:using fjxw.echarge.Models;using Microsoft.AspNetCore.Mvc;using Microsoft.Extensions.Logging;using System;using System.Collections.Generic;using System 阅读全文
posted @ 2022-03-27 11:20 .net&new 阅读(80) 评论(0) 推荐(0) 编辑
摘要:using Microsoft.AspNetCore.Builder;using Microsoft.AspNetCore.Hosting;using Microsoft.Extensions.Configuration;using Microsoft.Extensions.DependencyIn 阅读全文
posted @ 2022-03-27 11:17 .net&new 阅读(174) 评论(0) 推荐(0) 编辑
摘要:{ "ConnectionStrings": { "DefaultConnection": "server=localhost;uid=root;pwd=123456;port=3306;database=fjxw_echarge;" }, "Logging": { "LogLevel": { "D 阅读全文
posted @ 2022-03-27 11:16 .net&new 阅读(380) 评论(0) 推荐(0) 编辑
摘要:using fjxw.model;using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace fjxw.dal{ pu 阅读全文
posted @ 2022-03-27 11:14 .net&new 阅读(74) 评论(0) 推荐(0) 编辑
摘要:using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;using fjxw.model;namespace fjxw.dal{ pu 阅读全文
posted @ 2022-03-27 11:13 .net&new 阅读(41) 评论(0) 推荐(0) 编辑
摘要:using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;using MySql.Data.EntityFrameworkCore;us 阅读全文
posted @ 2022-03-27 11:09 .net&new 阅读(165) 评论(0) 推荐(0) 编辑
摘要:1:nuget安装 Install-Package MySql.Data.EntityFrameworkCore -Version 8.0.15 阅读全文
posted @ 2022-03-27 11:08 .net&new 阅读(85) 评论(0) 推荐(0) 编辑
摘要:1:先创建sysuser实体类 public class sysuser { /// <summary> /// 编号Id /// </summary> public int Id { get; set; } /// <summary> /// 用户名 /// </summary> public s 阅读全文
posted @ 2022-03-27 11:04 .net&new 阅读(74) 评论(0) 推荐(0) 编辑
摘要:在linux中备份mysql数据库,命令是: [root]# mysqldump -u 用户名 -p 密码 --all-databases > /home/mysql/bak.sql 如果报错就添加如下: mysqldump -h localhost -u root -p psword root@1 阅读全文
posted @ 2022-02-17 18:05 .net&new 阅读(564) 评论(0) 推荐(0) 编辑
摘要:安装环境 此处在Centos7进行安装,可以使用以下命令查看CentOS版本 lsb_release -a 在 CentOS 7安装docker要求系统为64位、系统内核版本为 3.10 以上,可以使用以下命令查看 uname -r 2、用yum源安装 2.1 查看是否已安装docker列表 yum 阅读全文
posted @ 2022-02-17 17:36 .net&new 阅读(135) 评论(0) 推荐(0) 编辑
摘要:1-单击宫格菜单的第一个“服务器管理器”; 2-在“快速启动(Q)”子菜单下,单击“2 添加角色和功能”; 3-点击左边“安装类型”,然后单击“基于角色或基于功能的安装”,再单击“下一步(N)”; 4-先单击“从服务器池中选择服务器”,再单击“本服务器的计算机名”,这个ip上只有本机,所以直接单击“ 阅读全文
posted @ 2021-09-28 19:52 .net&new 阅读(519) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示