نظرات مطالب
بررسی بهبودهای ProblemDetails در ASP.NET Core 7x
در ASP.NET Core 8.0 نیز امکان مدیریت استثناءها به صورت سراسری با پیاده‌سازی اینترفیس  IExceptionHandler مسیر شده است:
using Microsoft.AspNetCore.Diagnostics;
using Microsoft.AspNetCore.Mvc;

internal sealed class GlobalExceptionHandler : IExceptionHandler
{
    private readonly ILogger<GlobalExceptionHandler> _logger;

    public GlobalExceptionHandler(ILogger<GlobalExceptionHandler> logger)
    {
        _logger = logger;
    }

    public async ValueTask<bool> TryHandleAsync(
        HttpContext context,
        Exception exception,
        CancellationToken cancellationToken = default)
    {
        _logger.LogError(exception, "An unhandled exception has occurred while executing the request.");
        var problemDetails = new ProblemDetails
        {
            Status = StatusCodes.Status500InternalServerError,
            Title = "Server Error",
        };

        context.Response.StatusCode = StatusCodes.Status500InternalServerError;
        await context.Response.WriteAsJsonAsync(problemDetails);

        return true;
    }
}

برای ریجستر کردن آن نیز:
builder.Services.AddExceptionHandler<GlobalExceptionHandler>();
// other code
app.UseExceptionHandler();
اشتراک‌ها
PGlite - PostgreSQL را به صورت محلی در Node، Bun و همچنین در مرورگر اجرا کنید

PGlite is a WASM (Webassembly) based TypeScript/JavaScript client library which helps to run PostgreSQL locally in Browser or in NodeJS / Bun. It does not include any dependencies. It is very light weight and it's size is 3 MB Gzipped. It supports many Postgres extensions like pgvector, live queries, bloom, btree, earthdistance, fuzzymatch and lot morebun.

PGlite - PostgreSQL را به صورت محلی در Node، Bun و همچنین در مرورگر اجرا کنید
اشتراک‌ها
سری توسعه‌ی برنامه‌های #C در VS Code

C# and .NET Development in VS Code for Beginners
Writing C# applications in Visual Studio Code has never been easier!  We recently introduced the new C# Dev Kit extension In this video series, you’ll learn how to get started writing, debugging, testing, and running your C# applications productively in VS Code using the new C# Dev Kit extension. 

سری توسعه‌ی برنامه‌های #C در VS Code
اشتراک‌ها
دوره مقدماتی #C

C# Beginners Course
This school year, I give a course for young students at the beginning of their programming careers. They have no or very limited prior knowledge regarding coding. Therefore, we start at the very beginning and learn software development fundamentals using C# and .NET. 

دوره مقدماتی #C
نظرات مطالب
امن سازی برنامه‌های ASP.NET Core توسط IdentityServer 4x - قسمت چهاردهم- آماده شدن برای انتشار برنامه
- یک authorization server هست؛ یک UI هست برای Identity server.  
-  authorization server یک لایه نیست. قرار نیست جزئی از برنامه‌ی شما باشد. یک برنامه‌ی کاملا «مستقل» هست. هدف اصلی آن هم همین مستقل بودن و نقش تامین هویت مرکزی را بازی کردن هست و گرنه اگر قرار باشد این‌ها با هم یکی شوند، شاید بهتر باشد از ASP.NET Core Identity استفاده کنید. 
- این روش برای شرکتی طراحی شده که یک برنامه‌ی حسابداری دارد، یک برنامه‌ی مجزای منابع انسانی و مدیریت کارمندان، یک برنامه‌ی مجزای مالی و حقوق و دستمزد، یک برنامه‌ی مجزای حضور و غیاب، یک برنامه‌ی مجزای اعلانات شرکت و غیره. هر کدام از این برنامه‌ها هم یک دیتابیس مستقل دارند و قرار نیست تعاریف کاربران و اطلاعات و نقش‌های آن‌ها در بانک‌های اطلاعاتی هر کدام از این برنامه‌ها تکرار شوند. اینجا است که «برنامه‌ی مستقل» authorization server مرکزی معنا پیدا می‌کند.
اشتراک‌ها
روش پیاده سازی DDD

This is a practical guide for implementing the Domain Driven Design (DDD). While the implementation details rely on the ABP Framework infrastructure, core concepts, principles and patterns are applicable in any kind of solution, even if it is not a .NET solution. 

روش پیاده سازی DDD
اشتراک‌ها
با سی شارپ 8 از دست NullReferenceExceptions ها خلاص شوید

A .NET guideline specifies that an application should never throw a NullReferenceException. However, many applications and libraries do. The NullReferenceException is the most common exception happening. That’s why C# 8 tries to get rid of it. With C# 8, reference types are not null be default. This is a big change, and a great feature. However, what about all the legacy code? Can old libraries be used with C# 8 applications, and can C# 7 applications make use of C# 8 libraries?

This article demonstrates how C# 8 allows mixing old and new assemblies. 

با سی شارپ 8 از دست NullReferenceExceptions ها خلاص شوید