اشتراک‌ها
لیستی از C# Source Generators

C# Source Generators

A list of C# Source Generators (not necessarily awesome), because I haven't found a good list yet.

C# Source Generators is a Roslyn compiler feature introduced in C#9/.NET 5. It lets C# developers inspect user code and generate new C# source files that can be added to a compilation. 

لیستی از C# Source Generators
اشتراک‌ها
انتشار Microsoft Office 2024
Availability of Office 2024
Office 2024 comes in two editions. Office Home 2024 is $149.99 USD and includes Word, Excel, PowerPoint, and OneNote for one PC or Mac. Office Home & Business 2024 is $249.99 USD and comes with everything in Office Home 2024 plus Outlook and the rights to use the apps for commercial purposes. You can buy both editions from retailers worldwide and via Microsoft.com starting October 1, 2024.
انتشار Microsoft Office 2024
اشتراک‌ها
معرفی C# Source Generators

مخلص کلام اینکه : اگه با Fody یا PostSharp و همچنین Code Analyzer‌ها آشنایی دارین. این قابلیت یه چیزی تو مایه‌های ترکیب ایناس و بهتون اجازه میده موقع Compile شدن کد پروژه رو Analyze کنین و یه کد جدیدی بهش اضافه کنین. (مثلا پیاده سازی اینترفیس INotifyPropertyChanged به صورت خودکار به هنگام کامپایل)

We’re pleased to introduce the first preview of Source Generators, a new C# compiler feature that lets C# developers inspect user code and generate new C# source files that can be added to a compilation. This is done via a new kind of component that we’re calling a Source Generator.

To get started with Source Generators, you’ll need to install the latest .NET 5 preview and the latest Visual Studio preview

اطلاعات بیشتر 

نمونه ای از پیاده سازی INotifyPropertyChanged with C# 9.0 Source Generators  

معرفی C# Source Generators
اشتراک‌ها
بهبود قابل ملاحظه (30 برابری) کارآیی استفاده از Enums با استفاده از Source Generators

با استفاده از Source Generators از enum‌ها استفاده کنیم. این پکیچ با استفاده از Source Generator‌ها Reflection را حذف کرده و کد را در زمان Compile تولید میکند که باعث شده عملکرد حدود 30 برابر سریعتر شود.

بهبود قابل ملاحظه (30 برابری) کارآیی استفاده از Enums با استفاده از Source Generators