نظرات مطالب
شروع به کار با EF Core 1.0 - قسمت 6 - تعیین نوع‌های داده و ویژگی‌های آن‌ها
یک نکته‌ی تکمیلی: چگونه دقت خواصی از نوع decimal را به صورت سراسری تنظیم کنیم؟

فرض کنید قصد دارید دقت خواصی از نوع decimal را تنظیم کنید تا با اخطار زیر مواجه نشوید:
No type was specified for the decimal column 'Price' on entity type 'Movie'. 
This will cause values to be silently truncated if they do not fit in the default precision and scale.
یک روش رفع آن، قرار دادن ویژگی Column بر روی تک تک خواص از نوع decimal، در تمام موجودیت‌های تعریف شده و تنظیم دقت آن‌ها است:
public class Movie
{
    public int ID { get; set; }

    [Column(TypeName = "decimal(18, 2)")]
    public decimal Price { get; set; }
}
روش دیگر، انجام این تنظیم به صورت سراسری است:
protected override void OnModelCreating(ModelBuilder builder)
{
    base.OnModelCreating(builder);

    foreach (var property in builder.Model.GetEntityTypes()
                                    .SelectMany(t => t.GetProperties())
                                    .Where(p => p.ClrType == typeof(decimal)
                                                || p.ClrType == typeof(decimal?)))
    {
       property.SetColumnType("decimal(18, 6)");
    }
}
که هر دو نوع خاصیت decimal و ?decimal را پوشش می‌دهد.
اشتراک‌ها
XML bomb چیست؟

How Visual Studio 2022 ate up 100 GB of memory and what XML bombs had to do with it 

XML bomb چیست؟
اشتراک‌ها
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 و همچنین در مرورگر اجرا کنید
اشتراک‌ها
پشتیبانی از حالت تیره در Bootstrap 5.3

Bootstrap now supports color modes, starting with dark mode! With v5.3.0 you can implement your own color mode toggler (see below for an example from Bootstrap’s docs) and apply the different color modes as you see fit. We support a light mode (default) and now dark mode. 

پشتیبانی از حالت تیره در Bootstrap 5.3
اشتراک‌ها
Git for Windows 2.19.0 منتشر شد

New Features

Comes with Git v2.19.0.
There are now fast, built-in versions of git stash and git rebase, available as experimental options.
The included OpenSSH client now enables modern ciphers.
The gitweb component was removed because it is highly unlikely to be used on Windows.
The git archimport tool (which was probably used by exactly 0 users) is no longer included in Git for Windows. 

Git for Windows 2.19.0 منتشر شد
اشتراک‌ها
روش صحیح استفاده از ASP.NET Identity، بدون وابستگی Domain و سایر لایه ها به آن

The Problem

What they neglect to say is all that testability and persistence ignorance flies right out the window when you create a new ASP.NET Web Application using the MVC template and "Individual User Accounts" authentication. What you get is a single-layered application, tightly coupled to Entity Framework, that:

  • Ignores the patterns that facilitate testing, including: the repository pattern, unit of work pattern, and dependency injection;

  • Forces you to implement their IUser interface in your application’s User entity, thereby coupling it to ASP.NET Identity;

  • Eliminates any clear separation between your entities, persistence concerns, and business logic. Persistence ignorance? Forget about it.

Thankfully, due to the extensibility designed into ASP.NET Identity, it is possible to ditch the reference to the Microsoft.AspNet.Identity.EntityFramework assembly and write a custom implementation that can address these and other architectural issues. Just be forewarned: it is not a trivial undertaking, and you’ll have to put up with some code smell that is baked into the Microsoft.AspNet.Identity.Core assembly. 

روش صحیح استفاده از ASP.NET Identity، بدون وابستگی Domain و سایر لایه ها به آن
نظرات مطالب
چند نکته کاربردی درباره Entity Framework
به نظر من عنوان صحیح نیست. اصولا EF نامتصل هست. اینی که اینجا بحث شده در حقیقت دو حالت Dispose شده با نشده Context هست نه چیزی به عنوان Connected یا Disconnected