मुख्य सामग्री पर जाएँ
Skillpedia
सामान्य कोडिंग40k · #7151

csharp-async

यह क्या करती है

यह AI एजेंट asynchronous programming के अच्छे तरीकों को अपनाकर आपको C# code ज़्यादा कुशलता और सुरक्षित तरीके से लिखने में मदद करता है। यह आपके code की जाँच करता है ताकि वह तेज़ हो और आम गलतियों से बचे।

कब इस्तेमाल करें

  • ✓जब C# code लिखना हो जो एक साथ कई काम बिना अटके करे।
  • ✓जब आप चाहते हों कि आपका program और तेज़ी से जवाब दे।
  • ✓लंबे समय तक चलने वाले कामों वाले C# code में आम गलतियों से बचने के लिए।

Skill का लिंक

https://github.com/github/awesome-copilot/blob/main/skills/csharp-async/SKILL.md

इसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।

कैसे इस्तेमाल करें

सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।

पेस्ट करने के लिए तैयार मैसेज

इस skill से मेरी मदद करो: https://github.com/github/awesome-copilot/blob/main/skills/csharp-async/SKILL.md इस लिंक की SKILL.md फ़ाइल पढ़ो और मेरे काम में उसके निर्देशों का पालन करो।
क्या आप चाहते हैं कि आपका AI ऐसी skills खुद ढूँढे?मुफ़्त Skillpedia MCP इंस्टॉल करें: बस एक लाइन, और हर काम से पहले यह 15,000+ skills में खोजता है।1 मिनट में इंस्टॉल करें →

AI से क्या माँगें: उदाहरण

“इस C# code की समीक्षा करो और बताओ कि क्या मैं asynchronous programming सही तरह इस्तेमाल कर रहा हूँ: [आपका C# code यहाँ]”

हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।

यह कैसे काम करती है

एजेंट आपके code की तुलना C# asynchronous programming के नियमों और सुझावों से करता है। वह बताता है कि naming, error handling और performance में कहाँ सुधार हो सकता है, और आम गलतियों से कैसे बचा जाए।

तकनीकी सामग्री (मूल SKILL.md)

लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।

C# Async Programming Best Practices

Your goal is to help me follow best practices for asynchronous programming in C#.

Naming Conventions

  • Use the 'Async' suffix for all async methods
  • Match method names with their synchronous counterparts when applicable (e.g., GetDataAsync() for GetData())

Return Types

  • Return Task<T> when the method returns a value
  • Return Task when the method doesn't return a value
  • Consider ValueTask<T> for high-performance scenarios to reduce allocations
  • Avoid returning void for async methods except for event handlers

Exception Handling

  • Use try/catch blocks around await expressions
  • Avoid swallowing exceptions in async methods
  • Use ConfigureAwait(false) when appropriate to prevent deadlocks in library code
  • Propagate exceptions with Task.FromException() instead of throwing in async Task returning methods

Performance

  • Use Task.WhenAll() for parallel execution of multiple tasks
  • Use Task.WhenAny() for implementing timeouts or taking the first completed task
  • Avoid unnecessary async/await when simply passing through task results
  • Consider cancellation tokens for long-running operations

Common Pitfalls

  • Never use .Wait(), .Result, or .GetAwaiter().GetResult() in async code
  • Avoid mixing blocking and async code
  • Don't create async void methods (except for event handlers)
  • Always await Task-returning methods

Implementation Patterns

  • Implement the async command pattern for long-running operations
  • Use async streams (IAsyncEnumerable<T>) for processing sequences asynchronously
  • Consider the task-based asynchronous pattern (TAP) for public APIs

When reviewing my C# code, identify these issues and suggest improvements that follow these best practices.

अक्सर पूछे जाने वाले सवाल

asynchronous programming क्या है?

यह code लिखने का एक तरीका है जिसमें आपका program किसी समय लेने वाले काम (जैसे इंटरनेट से data लाना) के पूरा होने का इंतज़ार करते हुए बाकी काम भी कर सकता है, बस खाली बैठकर इंतज़ार नहीं करता।

best practices क्यों अपनाने चाहिए?

अच्छे तरीके अपनाने से आपका code तेज़ होता है, समझने में आसान रहता है, bugs की संभावना कम होती है, और आप व दूसरे programmers के लिए उसे संभालना सरल होता है।

'deadlocks' क्या होते हैं?

Deadlock तब होता है जब code के दो या उससे ज़्यादा हिस्से एक-दूसरे का अनिश्चित काल तक इंतज़ार करते रहते हैं, जिससे program अटक जाता है।

जानकारी

लेखक का मूल विवरण

Get best practices for C# async programming

repo: github/awesome-copilot

लोकप्रियता

GitHub स्टार
40k
रैंकिंग में स्थान
#7151
लाइसेंस
MIT
अपडेट की गई
15/10/2026

क्या यह skill काम की है?

0

लॉग इन करें वोट करने के लिए।

कमेंट

  • …

इस repository की और skills

acquire-codebase-knowledge

40k

आपके एजेंट को किसी मौजूदा code प्रोजेक्ट को समझने और उसका documentation बनाने में मदद करता है। यह नए लोगों को प्रोजेक्ट से जोड़ने या architecture का सार जानने में उपयोगी है।

लेखन और डॉक्यूमेंटडॉक्यूमेंटेशन

acreadiness-assess

40k

आपके एजेंट को किसी प्रोजेक्ट की AI के लिए तैयारी जाँचने और रिपोर्ट बनाने देता है। यह समझने में उपयोगी है कि प्रोजेक्ट AI tools इस्तेमाल करने के लिए कितना तैयार है।

लेखन और डॉक्यूमेंटडॉक्यूमेंटेशन

acreadiness-generate-instructions

40k

आपके एजेंट को assessment के आधार पर AI tools के लिए निर्देश बनाने में मदद करता है। यह बताता है कि AI कोड के साथ बेहतर कैसे काम करे और पहचानी गई कमियाँ कैसे दूर हों।

लेखन और डॉक्यूमेंटडॉक्यूमेंटेशन

acreadiness-policy

40k

आपके एजेंट को AI प्रोजेक्ट assessment के लिए नीतियाँ तय करने या लागू करने में मदद करता है। यह प्रोजेक्ट्स के मूल्यांकन को मानक बनाने और compliance सुनिश्चित करने में उपयोगी है।

AI और एजेंटएजेंट

मिलती-जुलती skills