December 12, 2023

LINQ: let Clause

In this post, let’s see what let is in LINQ query-syntax queries. I think it’s an overlooked feature in LINQ. Let’s consider the following query. IQueryable<string> wfhEmployees = from e in context.Employees                       &
December 6, 2023

ASP.NET Core 8.0: Securing Swagger UI Endpoints

With ASP.NET Core 8.0, now you can secure Swagger UI endpoints by calling MapSwagger().RequireAuthorization. Consider the following code example. WebApplicationBuilder builder = WebApplication.CreateBuilder(args); builder.Services.AddEndpointsApiExplorer();builder.Services.AddSwaggerGen(); builder.Services.AddAuthorization();builder.Services.AddAuthentication(“Bearer”