Looking for an optimized way to get a distinct list of strings in C#? Look no further than using a Hashset! This method provides constant time-performance for adding elements and ensures uniqueness. #CSharpTips #Optimization

gregintech_'s tweet image. Looking for an optimized way to get a distinct list of strings in C#? Look no further than using a Hashset! This method provides constant time-performance for adding elements and ensures uniqueness. #CSharpTips #Optimization

By using extension methods, you can enhance built-in or custom classes, making your code more readable and modular. **#CSharpTips #ExtensionMethods #CodeEnhancements #SoftwareEngineering #CodeReadability**

binyf07's tweet image. By using extension methods, you can enhance built-in or custom classes, making your code more readable and modular.

**#CSharpTips #ExtensionMethods #CodeEnhancements #SoftwareEngineering #CodeReadability**

در ASP.NET Core (نسخه .NET 9) ویژگی MapStaticAssets اضافه شده که تحویل فایل‌های ایستا (CSS/JS/تصاویر) را برای SPA یا Blazor بهینه‌تر می‌کند: با کش‌بندی خودکار، فشرده‌سازی و fingerprinting. #CSharpTips


🔸 I keep getting “file in use” errors in C# Remember to close or dispose of file streams. Using using blocks helps prevent locked resources. #FileHandling #CSharpTips #Code

IBL_SystemHouse's tweet image. 🔸 I keep getting “file in use” errors in C#

Remember to close or dispose of file streams. Using using blocks helps prevent locked resources.

#FileHandling #CSharpTips #Code

در .NET 7، از RequiredMemberAttribute برای record و struct استفاده کن؛ کامپایلر مجبور می‌کنه همه propertyهای ضروری مقداردهی بشن از بروز خطاهای runtime و objectهای ناقص جلوگیری می‌کنه #CSharpTips


Explora estas pautas esenciales para escribir código más eficiente y robusto en C#. 💡💻 Nuestros consejos de C# te guiarán hacia la excelencia. #CSharpTips #DesarrolloDeSoftware

beparrot_co's tweet image. Explora estas pautas esenciales para escribir código más eficiente y robusto en C#. 💡💻

Nuestros consejos de C# te guiarán hacia la excelencia.

#CSharpTips #DesarrolloDeSoftware

استفاده از ArrayPool<T> برای کاهش تخصیص حافظه با ArrayPool.Shared.Rent() آرایه‌ها رو از pool می‌گیری و دوباره برمی‌گردونی. در اپلیکیشن‌های high throughput (مانند APIهای پرترافیک) باعث کاهش GC pressure و افزایش performance می‌شه. #CSharpTips


Method 2: Collections Export a List<t> or object collection using IWorksheet.ImportData(). It supports nested objects and grouping options, which are useful for complex data models. ➡️ Next, let’s explore database exports 👇 #CSharpTips #Excel #List #ObjectCollections (4/8)

Syncfusion's tweet image. Method 2: Collections
Export a List&amp;lt;t&amp;gt; or object collection using IWorksheet.ImportData(). It supports nested objects and grouping options, which are useful for complex data models.
➡️ Next, let’s explore database exports 👇
#CSharpTips #Excel #List #ObjectCollections
(4/8)

با استفاده از Lazy<T> شیء رو فقط وقتی میسازه که واقعاً بهش نیاز هست، نه در زمان initialization. باعث کاهش مصرف حافظه و افزایش startup speed می‌شه. #CSharpTips


در دات نت، وقتی از FrozenDictionary ها میخوایم استفاده کنیم، پشت صحنه در Runtime بر اساس نوع دیتاستی که داره استفاده میشه، یه پیاده سازی مجزا داره برای همین ساختش هزینه بر هست، ولی خوانش دیتا سرعت عالی داره #CSharpTips


قبلاً برای عملگرهای ریاضی باید overloadهای جدا یا switchهای بزرگ می‌نوشتی. الان می‌تونی روی genericها عملگرهای ریاضی داشته باشی بدون پیچیدگی. #CSharpTips


در دات نت 9، Params Span معرفی شده حالا می‌تونی از params ReadOnlySpan<T> در متدها استفاده کنی، بدون ساخت آرایه جدید. کاهش allocation، کارایی بالاتر و مخصوص سناریوهای performance-critical #CSharpTips


SemaphoreSlim بهتر از lock در async lock با async قابل استفاده نیست. SemaphoreSlim lightweight و async-friendly هست، و برای throttle کردن دسترسی به یک resource فوق‌العاده‌ست. #CSharpTips


در c# 10 به بعد می‌تونی using های تکراری رو یک‌بار در یک فایل بنویسی و از کل پروژه حذفشون کنی. بهش Global Using میگن که باعث میشه کد تمیزتر بشه. #CSharpTips


در دات نت 8، ساختار جدیدی به نام InlineArray اضافه شده می‌تونی یه آرایه با اندازه ثابت داخل struct تعریف کنی، بدون تخصیص heap. کارایی خیلی بالا (zero allocation) مناسب برای پردازش داده‌های کوچک استفاده با attribute [InlineArray(n)] روی struct #CSharpTips


در .NET 9، کتابخانه‌ی System.Text.Json حالا از polymorphic serialization واقعی پشتیبانی می‌کنه می‌تونی typeهای فرزند رو با attribute‌ مثل [JsonDerivedType] ثبت کنی تا بدون custom converter به‌درستی serialize/deserialize بشن #CSharpTips


لا توجد نتائج لـ "#csharptips"
لا توجد نتائج لـ "#csharptips"
لا توجد نتائج لـ "#csharptips"
Loading...

Something went wrong.


Something went wrong.


United States Trends