上一页 1 ··· 8 9 10 11 12 13 14 15 16 ··· 65 下一页
摘要: namespace JWTWebApi.JWT; public class JwtOptions { /// <summary> /// 签发者 /// </summary> public string Issuer { get; set; } /// <summary> /// 接收者 /// < 阅读全文
posted @ 2023-06-02 17:04 vba是最好的语言 阅读(21) 评论(0) 推荐(0) 编辑
摘要: 1,nuget增加 FluentValidation.AspNetCore 2. DI中添加 builder.Services.AddFluentValidation(opt=>{ opt.RegisterValidatorsFromAssembly( Assembly.GetEntryAssemb 阅读全文
posted @ 2023-06-01 22:09 vba是最好的语言 阅读(98) 评论(0) 推荐(0) 编辑
摘要: 一 基本代码实现: using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Authorization; [Route("home")] [AllowAnonymous] public class HomeController : Con 阅读全文
posted @ 2023-05-31 10:19 vba是最好的语言 阅读(226) 评论(0) 推荐(0) 编辑
摘要: [HttpGet("asyncsale")] public async IAsyncEnumerable<Product> GetOnSaleProductsAsync() { var products = _repository.GetProductsAsync(); await foreach 阅读全文
posted @ 2023-05-30 10:12 vba是最好的语言 阅读(40) 评论(0) 推荐(0) 编辑
摘要: using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata.Builders; public class MemberConfig : IEntityTypeConfiguration<Membe 阅读全文
posted @ 2023-05-29 21:54 vba是最好的语言 阅读(24) 评论(0) 推荐(0) 编辑
摘要: https://learn.microsoft.com/zh-cn/aspnet/core/fundamentals/http-requests?view=aspnetcore-6.0 // Add services to the container. builder.Services.AddHtt 阅读全文
posted @ 2023-05-29 18:03 vba是最好的语言 阅读(10) 评论(0) 推荐(0) 编辑
摘要: using Microsoft.EntityFrameworkCore; public static class ProductsModule { public static void RegisterProductsEndpoints(this IEndpointRouteBuilder endp 阅读全文
posted @ 2023-05-28 10:31 vba是最好的语言 阅读(88) 评论(0) 推荐(0) 编辑
摘要: public class PeriodicBackgroundTask : BackgroundService { private readonly TimeSpan _period = TimeSpan.FromSeconds(5); private readonly ILogger<Period 阅读全文
posted @ 2023-05-28 10:18 vba是最好的语言 阅读(103) 评论(0) 推荐(0) 编辑
摘要: internal WebApplicationBuilder(WebApplicationOptions options, Action<IHostBuilder>? configureDefaults = null) { var configuration = new ConfigurationM 阅读全文
posted @ 2023-05-27 16:58 vba是最好的语言 阅读(139) 评论(0) 推荐(0) 编辑
摘要: 整个流程整理下。这种简单的Add可以运行。 1先创建ConfigurationSource继承FileConfigurtaionSource 1)ConfigurationBuilder.Add(Source); 2)Builder()->IConfigurationProvider Build(I 阅读全文
posted @ 2023-05-27 09:56 vba是最好的语言 阅读(12) 评论(0) 推荐(0) 编辑
上一页 1 ··· 8 9 10 11 12 13 14 15 16 ··· 65 下一页