Remove hardwired return type in ExecuteScriptCommand#725
Remove hardwired return type in ExecuteScriptCommand#725filipw merged 4 commits intodotnet-script:masterfrom
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. |
| } | ||
|
|
||
| public void Execute(PublishCommandOptions options) | ||
| public void Execute<TReturn>(PublishCommandOptions options) |
There was a problem hiding this comment.
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.
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
ExecuteScriptCommand return type should be generic. This PR removes the hardwired return type, pushes it up to Program.cs and passes generic type.