اشتراک‌ها
بهبود کارآیی و کاهش مصرف حافظه‌ی Stack Overflow با ارتقاء از NET 4.6.2. به NET 5.0.

"We migrated Stack Overflow's ad server from .NET 4.6.2 to .NET 5.0 and we are testing it on a canary server in production. We are seeing big improvements in memory usage and in server response times. It wasn't the main goal of the migration, but definitely a nice to have" / Twitter 

بهبود کارآیی و کاهش مصرف حافظه‌ی Stack Overflow با ارتقاء از NET 4.6.2. به NET 5.0.
اشتراک‌ها
تاثیر بروز استثناءها بر روی کارآیی برنامه

In order to cleanse the data as we parse it, we thought using a try/catch would be ok. If we don’t catch the exceptions, we’re good, right?
Turns out it kills our performance when we throw a lot of exceptions, even if we don’t catch them. Each exception has some costs . We needed to find a way to handle this data without involving exceptions.
TryParse turns out to be a method designed to solve our problem. We ran some benchmarks to prove it. 

تاثیر بروز استثناءها بر روی کارآیی برنامه
اشتراک‌ها
پیاده سازی AutoPostBack در ASP.NET Core

Those of you who worked with ASP.NET web forms will recollect that certain server controls such as DropDownList have a property called AutoPostBack. This property when set to true automatically submits the form to the server whenever the selection changes and raises some server side event. In modern web development people prefer to use Ajax over AutoPostBack but at times AutoPostBack is what you might need. To that end this article shows how AutoPostBack can be implemented in ASP.NET Core applications. 

پیاده سازی AutoPostBack در ASP.NET Core
نظرات مطالب
روش بهینه‌ی بررسی خالی بودن مجموعه‌ها و آرایه‌ها در NET 5.0.
یک نکته‌ی تکمیلی: اضافه شدن متد TryGetNonEnumeratedCount به دات نت 6
public static bool TryGetNonEnumeratedCount(this IEnumerable<T> source, out int count);

زمانیکه متد ()Count را بر روی یک <IEnumerable<T فراخوانی می‌کنیم، دو کار ممکن رخ می‌دهند:
الف) کتابخانه‌ی LINQ سعی می‌کند تا این نوع را به یکی از انواع مشتق شده‌ی از IEnumerable که دارای خاصیت Count است (مانند IList و امثال آن)، تبدیل کند تا بر این اساس بتواند به سرعت تعداد عناصر آن‌را تشخیص دهد.
ب) اگر حالت الف میسر نشد، تمام عناصر IEnumerable را جهت یافتن تعداد آن‌ها، پیمایش و شمارش می‌کند که این عملیات برای مجموعه‌های بزرگ می‌تواند بسیار زمانبر باشد.

اکنون در دات نت 6، حالت امن گزینه‌ی الف، با ارائه‌ی متد الحاقی جدید TryGetNonEnumeratedCount، میسر شده‌است. یعنی اگر مجموعه‌ی مدنظر به همراه خاصیت Count بود، بلافاصله از آن استفاده کرده و خروجی out آن‌را ارائه می‌دهد، در غیراینصورت false را بر می‌گرداند و مقدار count صفر خواهد بود؛ یعنی حالت ب را دیگر هیچگاه اجرا نخواهد کرد و به این ترتیب می‌توان به کنترل بیشتری بر روی API ارائه شده رسید.
if (movies.TryGetNonEnumeratedCount(out int count))
{
    Console.WriteLine($"The count is {count}");
}
else
{
    Console.WriteLine("Could not get a count of movies without enumerating the collection");
}
اشتراک‌ها
#C به عنوان یک زبان سیستمی

When you think about C#, you'll usually think about a high-level language, one that is utilized to build websites, APIs, and desktop applications. However, from its inception, C# had the foundation to be used as a system language, with facilities that allow you direct memory access and fine-grained control over memory and execution.

 
#C به عنوان یک زبان سیستمی
اشتراک‌ها
101 مثال از LINQ در اندروید

This project contains the C# 101 LINQ Samples rewritten to Kotlin. Like the existing Java LINQ Examples, Kotlin examples run and have their results displayed inside an Android App courtesy of the rich support for Kotlin in Android Studio. 

101 مثال از LINQ در اندروید
اشتراک‌ها
NET 8 RC1. منتشر شد

.NET 8 RC1 is now available. This is our first of two release candidates. This release includes a new AOT mode for both Android and WASM, System.Text.Json improvements, and Azure Managed Identity support for containers. Now is great time to pick up and test .NET 8 if you haven’t yet.  

NET 8 RC1. منتشر شد
اشتراک‌ها
نگاهی به ویژگی های جدید 6 #C

The C# language itself has changed little in version 6, the main importance of the release being the introduction of the Roslyn .NET Compiler Platform. However the New features and improvements that have been made to C# are welcome because they are aimed at aiding productivity. Paulo Morgado explains what they are, and how to use them. 

نگاهی به ویژگی های جدید 6 #C