摘要:
namespace JWTWebApi.JWT; public class JwtOptions { /// <summary> /// 签发者 /// </summary> public string Issuer { get; set; } /// <summary> /// 接收者 /// < 阅读全文
摘要:
1,nuget增加 FluentValidation.AspNetCore 2. DI中添加 builder.Services.AddFluentValidation(opt=>{ opt.RegisterValidatorsFromAssembly( Assembly.GetEntryAssemb 阅读全文
摘要:
一 基本代码实现: using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Authorization; [Route("home")] [AllowAnonymous] public class HomeController : Con 阅读全文
摘要:
[HttpGet("asyncsale")] public async IAsyncEnumerable<Product> GetOnSaleProductsAsync() { var products = _repository.GetProductsAsync(); await foreach 阅读全文
摘要:
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata.Builders; public class MemberConfig : IEntityTypeConfiguration<Membe 阅读全文
摘要:
https://learn.microsoft.com/zh-cn/aspnet/core/fundamentals/http-requests?view=aspnetcore-6.0 // Add services to the container. builder.Services.AddHtt 阅读全文
摘要:
using Microsoft.EntityFrameworkCore; public static class ProductsModule { public static void RegisterProductsEndpoints(this IEndpointRouteBuilder endp 阅读全文
摘要:
public class PeriodicBackgroundTask : BackgroundService { private readonly TimeSpan _period = TimeSpan.FromSeconds(5); private readonly ILogger<Period 阅读全文
摘要:
internal WebApplicationBuilder(WebApplicationOptions options, Action<IHostBuilder>? configureDefaults = null) { var configuration = new ConfigurationM 阅读全文
摘要:
整个流程整理下。这种简单的Add可以运行。 1先创建ConfigurationSource继承FileConfigurtaionSource 1)ConfigurationBuilder.Add(Source); 2)Builder()->IConfigurationProvider Build(I 阅读全文