You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Allows an application to include multiple extensions of the native types
And has two key flaws:
You can't create an instance of an interface
Library users would have to manually define an implementation for every type they use
Both flaws are dealbreakers, which leads to the second step - implementing a source generator. The source generator will automatically produce all necessary implementation classes at compile time. Since this runs at application compile time, rather than library compile time, the implementation class is guaranteed to have all fields supported by the application. Application users would just need to create an empty partial class for each type needed.
The text was updated successfully, but these errors were encountered:
This is to explore a possible implementation of JSON-LD based on interfaces and Roslyn Source Generators. If successful, this will resolve #2.
The first step is to model all AP / AS types as interfaces rather than classes. This accomplishes two key things:
And has two key flaws:
Both flaws are dealbreakers, which leads to the second step - implementing a source generator. The source generator will automatically produce all necessary implementation classes at compile time. Since this runs at application compile time, rather than library compile time, the implementation class is guaranteed to have all fields supported by the application. Application users would just need to create an empty partial class for each type needed.
The text was updated successfully, but these errors were encountered: