-
Is it possible to use SqlClient to query sql server using IIncrementalGenerator. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Source generators should be quite fast and not have external dependencies; you should not be doing calls to external servers like SQL. |
Beta Was this translation helpful? Give feedback.
-
External I/O (including but not limited to reading or writing files on disk) is not allowed in a source generator. All non-source inputs to a source generator need to be gathered during earlier steps of the build, and provided to the source generator through the |
Beta Was this translation helpful? Give feedback.
External I/O (including but not limited to reading or writing files on disk) is not allowed in a source generator. All non-source inputs to a source generator need to be gathered during earlier steps of the build, and provided to the source generator through the
<AdditionalFiles>
mechanism in the compiler. A pre-build step to gather this information in a file could be designed to read data from an SQL server.