Design review: Change AddNodeServices to take an Action<NodeServicesOptions> like other aspects of MVC DI config

This commit is contained in:
SteveSandersonMS
2016-09-01 17:46:59 +01:00
parent f04fb8c421
commit f0d954b2a6
11 changed files with 150 additions and 141 deletions

View File

@@ -35,7 +35,7 @@ namespace Microsoft.AspNetCore.NodeServices.HostingModels
private int _portNumber;
public HttpNodeInstance(string projectPath, string[] watchFileExtensions, ILogger nodeInstanceOutputLogger,
IDictionary<string, string> environmentVars, bool launchWithDebugging, int? debuggingPort, int port = 0)
IDictionary<string, string> environmentVars, bool launchWithDebugging, int debuggingPort, int port = 0)
: base(
EmbeddedResourceReader.Read(
typeof(HttpNodeInstance),

View File

@@ -49,7 +49,7 @@ If you haven't yet installed node-inspector, you can do so as follows:
ILogger nodeOutputLogger,
IDictionary<string, string> environmentVars,
bool launchWithDebugging,
int? debuggingPort)
int debuggingPort)
{
if (nodeOutputLogger == null)
{
@@ -101,12 +101,12 @@ If you haven't yet installed node-inspector, you can do so as follows:
// This method is virtual, as it provides a way to override the NODE_PATH or the path to node.exe
protected virtual ProcessStartInfo PrepareNodeProcessStartInfo(
string entryPointFilename, string projectPath, string commandLineArguments,
IDictionary<string, string> environmentVars, bool launchWithDebugging, int? debuggingPort)
IDictionary<string, string> environmentVars, bool launchWithDebugging, int debuggingPort)
{
string debuggingArgs;
if (launchWithDebugging)
{
debuggingArgs = debuggingPort.HasValue ? $"--debug={debuggingPort.Value} " : "--debug ";
debuggingArgs = debuggingPort != default(int) ? $"--debug={debuggingPort} " : "--debug ";
_nodeDebuggingPort = debuggingPort;
}
else

View File

@@ -40,7 +40,7 @@ namespace Microsoft.AspNetCore.NodeServices.HostingModels
public SocketNodeInstance(string projectPath, string[] watchFileExtensions, string socketAddress,
ILogger nodeInstanceOutputLogger, IDictionary<string, string> environmentVars,
bool launchWithDebugging, int? debuggingPort)
bool launchWithDebugging, int debuggingPort)
: base(
EmbeddedResourceReader.Read(
typeof(SocketNodeInstance),