#csharptips resultados da pesquisa

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

در دات نت 9، در DataContractSerializer بهینه‌سازی بزرگی صورت گرفته؛ الان از source generation پشتیبانی می‌کنه یعنی serialization سریع‌تر، بدون reflection و با حافظه‌ی کمتر عالی برای سرویس‌های gRPC و WCF-style #CSharpTips


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**

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

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


در .NET 8 به بعد، FrozenDictionary و FrozenSet معرفی شدن ساختارهایی immutable و optimized for read performance #CSharpTips


در .NET 8، از app.MapFallback() استفاده کن تا درخواست‌های بدون مسیر مشخص رو مدیریت کنی. ایده‌آل برای SPAها (مثل React/Vue) یا صفحات خطای سفارشی کدت تمیزتر و routing پیش‌بینی‌پذیرتر میشه #CSharpTips


در .NET 8، از keyed services در DI استفاده کن. می‌تونی چند پیاده‌سازی از یه interface داشته باشی و با کلید مشخص انتخابشون کنی دیگه نیازی به if-else یا factory دستی نیست، تزریق تمیز و منعطف‌تر #CSharpTips


در .NET 8، از TypedResults در Minimal API استفاده کن. به‌جای برگردوندن object خام، خروجی دقیق مثل TypedResults.Ok(), NotFound() بده کد strongly-typed، خواناتر خطای کمتر در زمان کامپایل #CSharpTips


در .NET 8، برای validation تمیزتر، از IEndpointFilter در Minimal API استفاده کن. می‌تونی منطق اعتبارسنجی، authorization یا logging رو قبل از اجرای handler جدا کنی _کد تمیزتر، تست‌پذیرتر و قابل‌گسترش‌تر #CSharpTips


در .NET 8، ویژگی Metrics APIs اضافه شده؛ ابزاری داخلی برای جمع‌آوری و ثبت متریک‌ها مثل latency، count و histogram بدون نیاز به کتابخانه خارجی. مناسب برای observability و مانیتورینگ. #CSharpTips


در .NET 8، از MapGroup + versioning برای API نسخه‌دار استفاده کن. هر نسخه‌ی API رو در یه گروه بساز و middleware یا policy مخصوص خودش رو بده مدیریت نسخه‌ها تمیز، مقیاس‌پذیر و قابل‌نگهداری‌تر میشه #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)

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


در .NET 8، از Task.WaitAsync(timeout) استفاده کن تا برای هر async task زمان انتظار تعیین کنی دیگه نیازی به CancellationTokenSource و منطق پیچیده timeout نداری تمیز، ساده و قابل‌کنترل #CSharpTips


تو entity framework) ورژن های جدیدترش) میتونی از ExecuteUpdate و ExecuteDelete استفاده کنی. بدون load کردن entity ها، مستقیم query SQL اجرا می‌کنه - سرعت بالا و مصرف حافظه‌ی کمتر #CSharpTips


در .NET 8، از OutputCache middleware استفاده کن تا خروجی endpointها رو کش کنی می‌تونی بر اساس path، header یا query params کلید کش بسازی کاهش فشار روی دیتابیس و پاسخ‌دهی آنی #CSharpTips


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


در دات نت 9، در DataContractSerializer بهینه‌سازی بزرگی صورت گرفته؛ الان از source generation پشتیبانی می‌کنه یعنی serialization سریع‌تر، بدون reflection و با حافظه‌ی کمتر عالی برای سرویس‌های gRPC و WCF-style #CSharpTips


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


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


در دات نت 9 FrozenSet<T> و FrozenDictionary<TKey,TValue> بهبود پیدا کردن ساختشون زمان‌بره، ولی بعد از فریز شدن دسترسی فوق‌العاده سریع دارن. عالی برای lookupهای ثابت و داده‌های فقط‌خواندنی در اپ‌های بزرگ #CSharpTips


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


در .net9 Extension type معرفی شد می‌تونی به typeهای موجود مثل string یا DateTime، متد و property اضافه کنی بدون subclass یا helper static. کد expressive‌تر و سازمان‌یافته‌تر #CSharpTips


در .Net7 کلاس Generic math معرفی شد الان می‌تونی متدهای generic بنویسی که با هر نوع عددی (int, double, decimal) کار کنن، بدون کد تکراری کد تمیزتر، reusable و مناسب برای محاسبات عددی پیچیده #CSharpTips


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


در .NET 7، متدهای RegexGenerator معرفی شدن با استفاده از attribute [GeneratedRegex]، regex در زمان کامپایل تولید می‌شه نه runtime سرعت بالاتر تخصیص حافظه کمتر بدون JIT overhead #CSharpTips


در .NET 8، از Task.WaitAsync(timeout) استفاده کن تا برای هر async task زمان انتظار تعیین کنی دیگه نیازی به CancellationTokenSource و منطق پیچیده timeout نداری تمیز، ساده و قابل‌کنترل #CSharpTips


در .NET 8، از IFormFile.CopyToAsync(Stream, CancellationToken) استفاده کن تا آپلود فایل‌ها رو ایمن‌تر و قابل لغو کنی بهتر از روش‌های قدیمی هست چون memory کمتر مصرف می‌کنه و responsive‌تره (async و cancelation token اضافه شده) #CSharpTips


در .NET 8، از app.MapFallback() استفاده کن تا درخواست‌های بدون مسیر مشخص رو مدیریت کنی. ایده‌آل برای SPAها (مثل React/Vue) یا صفحات خطای سفارشی کدت تمیزتر و routing پیش‌بینی‌پذیرتر میشه #CSharpTips


در .NET 8، از TypedResults در Minimal API استفاده کن. به‌جای برگردوندن object خام، خروجی دقیق مثل TypedResults.Ok(), NotFound() بده کد strongly-typed، خواناتر خطای کمتر در زمان کامپایل #CSharpTips


در .NET 8، از MapGroup + versioning برای API نسخه‌دار استفاده کن. هر نسخه‌ی API رو در یه گروه بساز و middleware یا policy مخصوص خودش رو بده مدیریت نسخه‌ها تمیز، مقیاس‌پذیر و قابل‌نگهداری‌تر میشه #CSharpTips


در .NET 8، از OutputCache middleware استفاده کن تا خروجی endpointها رو کش کنی می‌تونی بر اساس path، header یا query params کلید کش بسازی کاهش فشار روی دیتابیس و پاسخ‌دهی آنی #CSharpTips


در .NET 8، از keyed services در DI استفاده کن. می‌تونی چند پیاده‌سازی از یه interface داشته باشی و با کلید مشخص انتخابشون کنی دیگه نیازی به if-else یا factory دستی نیست، تزریق تمیز و منعطف‌تر #CSharpTips


در .NET 8، برای validation تمیزتر، از IEndpointFilter در Minimal API استفاده کن. می‌تونی منطق اعتبارسنجی، authorization یا logging رو قبل از اجرای handler جدا کنی _کد تمیزتر، تست‌پذیرتر و قابل‌گسترش‌تر #CSharpTips


در EF Core 8 می‌تونی از JSON column mapping استفاده کنی اینجوری propertyهای complex رو مستقیم داخل ستون JSON ذخیره کن. سازگاری مناسب با PostgreSQL و SQL Server #CSharpTips


تو entity framework) ورژن های جدیدترش) میتونی از ExecuteUpdate و ExecuteDelete استفاده کنی. بدون load کردن entity ها، مستقیم query SQL اجرا می‌کنه - سرعت بالا و مصرف حافظه‌ی کمتر #CSharpTips


در .NET 8، می‌تونی از Rate Limiting Middleware استفاده کنی مستقیماً در pipeline درخواست‌ها محدودیت درخواست تعریف کن، بدون نیاز به پکیج خارجی کنترل ترافیک جلوگیری از abuse حفظ پایداری سرویس #CSharpTips


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

Let's talk optimisation and pooling! In Unity, allocation can seem pretty simple since everything is handled by the language. Most of us call "new" on class without blinking. The truth is we should blink, a lot. #unitytips #csharptips

indyNarf's tweet image. Let&apos;s talk optimisation and pooling!

In Unity, allocation can seem pretty simple since everything is handled by the language. Most of us call &quot;new&quot; on class without blinking.
The truth is we should blink, a lot.

#unitytips #csharptips

💡 Did you know that C# has local functions that help unclutter your code? 💡 They are great when you need to repeat yourself several times with a method, but exposing this method your class is meaningless elsewhere. #unity3d #unitytips #csharptips

BestlaGaming's tweet image. 💡 Did you know that C# has local functions that help unclutter your code? 💡 
They are great when you need to repeat yourself several times with a method, but exposing this method your class is meaningless elsewhere. #unity3d #unitytips #csharptips

Según me vaya dando, iré escribiendo pequeños consejos y micro-tutoriales de uno de los lenguajes más usados hoy en día, sobre todo gracias a Xamarin y Unity #CSharpTips


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**

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)

Whenever possible, in C#, use Lambda-bodied expressions instead of conventional method bodies. Why? - It makes code declarative, instead of imperative - It prevents mutable variable assignments - It is 2 lines shorter #csharp #csharptips #programming

SilasReinagel's tweet image. Whenever possible, in C#, use Lambda-bodied expressions instead of conventional method bodies. 

Why?
- It makes code declarative, instead of imperative
- It prevents mutable variable assignments
- It is 2 lines shorter

#csharp #csharptips #programming

#unityTips #CSharpTips How to remove lambda listener from the event? Create a delegate instance field from the lambda. Assign it to the listener. Then, if you need, remove it from the listener. Ref: stackoverflow.com/questions/1362…

KroyanArshak's tweet image. #unityTips #CSharpTips
How to remove lambda listener from the event?
Create a delegate instance field from the lambda.
Assign it to the listener.
Then, if you need, remove it from the listener.

Ref:
stackoverflow.com/questions/1362…

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

Loading...

Something went wrong.


Something went wrong.


United States Trends