-
Notifications
You must be signed in to change notification settings - Fork 174
Remove hardwired return type in ExecuteScriptCommand #725
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
Conversation
thanks - can you explain your use case? |
Sure! I needed to run CSX files directly from .NET runtime, and have a custom object as a return type for further processing. I found this great post which got me up-and-running in no time. But I found that it doesn't correctly load all assemblies when referencing some nuget packages. For instance Microsoft.Data.SqlClient nuget fails to load "SNI.dll", although it works correctly from CLI. So I backtraced it, and after the modification in this PR, I ended using the ExecuteScriptCommand directly which works great. |
@@ -17,7 +17,7 @@ public PublishCommand(ScriptConsole scriptConsole, LogFactory logFactory) | |||
_logFactory = logFactory; | |||
} | |||
|
|||
public void Execute(PublishCommandOptions options) | |||
public void Execute<TReturn>(PublishCommandOptions options) |
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.
makes sense thanks. It's technically a breaking change - could you please keep the old one too and add the generic as a new overload?
It does not matter that much but I would like to have backwards compatibility in the public API unless we rev up major version
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.
Yes, you're right, should be an overload, backwards compatibility is very important. Sure, I'll add it
Keep previous method signature for backwards compatibility
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.
thanks!
ExecuteScriptCommand return type should be generic. This PR removes the hardwired return type, pushes it up to Program.cs and passes generic type.