学海无涯

导航

随笔分类 -  ASP.NET Core

上一页 1 2

RedirectToAction 导航
摘要:插入数据后,导航到 GetByName 方法: [HttpPost("Create")] public async Task<ActionResult> Create() { User u1 = new User { Name = "杨中科" }; Leave leave = new Leave() 阅读全文

posted @ 2022-09-29 16:15 宁静致远. 阅读(54) 评论(0) 推荐(0)

使用appsettings.json配置和依赖注入调用Serilog日志模块
摘要:appsettings.json配置Serilog { //"Logging": { // "LogLevel": { // "Default": "Information", // "Microsoft.AspNetCore": "Warning" // } //}, "Serilog": { " 阅读全文

posted @ 2022-09-26 18:22 宁静致远. 阅读(445) 评论(0) 推荐(1)

客户端URL路径组织模式
摘要:namespace WebMVC.Infrastructure; public static class API { public static class Purchase { public static string AddItemToBasket(string baseUri) => $"{b 阅读全文

posted @ 2022-09-24 11:36 宁静致远. 阅读(36) 评论(0) 推荐(0)

Service模块读取AppSettings.json
摘要:创建对应的映射类: public class AppSettings { //public Connectionstrings ConnectionStrings { get; set; } public string PurchaseUrl { get; set; } public string 阅读全文

posted @ 2022-09-24 11:33 宁静致远. 阅读(30) 评论(0) 推荐(0)

ASP.NET Core雪花算法分布式ID生成工具类
摘要:安装: 1.NuGet中添加 OnceMi.AspNetCore.IdGenerator 程序集 2.Program中设置参数 //AppId,Appid范围为0-63 builder.Services.AddIdGenerator(m => { m.AppId = 1; }); 3.获取ID [A 阅读全文

posted @ 2022-09-12 16:47 宁静致远. 阅读(1088) 评论(0) 推荐(0)

上一页 1 2