-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Design: Refine code generation APIs #10481
Conversation
/// A service typically implemented by database providers to generate code fragments | ||
/// for reverse engineering. | ||
/// </summary> | ||
public interface IScaffoldingProviderCodeGenerator2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will rename 😏
|
||
foreach (var argument in arguments) | ||
{ | ||
Arguments.Add(argument); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AddRange or ctor args to create the list.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IList doesn't have AddRange, and I couldn't see an already existing extension method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
Though we are dropping one function for provider here. Provider can no longer generate something custom based on connection string. Not sure how useful it is. Awaiting rename for sign-off
Looks like I need to update Oracle more too... |
Yeah, I debated whether to use MethodCallCodeFragment here too... |
I was thinking more like, for SqlServer provider, provider can use connection string to find out server version and call those additional things like |
We'll YAGNI it for now. Now we can actually evolve this service without breaking providers. 😉 |
Filed #10487 |
This removes the concept of the programming language from the provider APIs.
@@ -26,6 +26,7 @@ public static class ScaffoldingServiceCollectionExtensions | |||
public static IServiceCollection AddScaffolding([NotNull] this IServiceCollection serviceCollection, [NotNull] IOperationReporter reporter) | |||
=> serviceCollection | |||
.AddSingleton<AnnotationCodeGeneratorDependencies>() | |||
.AddSingleton<CoreTypeMapperDependencies>() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We really need to add more RevEng tests. (#9111) I'll try to get to it soon.
cc @ajcvickers
This removes the concept of the programming language from the provider APIs.