Add copy constructor to deployment parameters (#1497)

This commit is contained in:
Justin Kotalik 2018-07-18 14:28:48 -07:00 committed by GitHub
parent 19839ed308
commit 21d9ec64f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 21 additions and 0 deletions

View File

@ -78,6 +78,27 @@ namespace Microsoft.AspNetCore.Server.IntegrationTesting
}
}
public DeploymentParameters(DeploymentParameters parameters)
{
foreach (var propertyInfo in typeof(DeploymentParameters).GetProperties())
{
if (propertyInfo.CanWrite)
{
propertyInfo.SetValue(this, propertyInfo.GetValue(parameters));
}
}
foreach (var kvp in parameters.EnvironmentVariables)
{
EnvironmentVariables.Add(kvp);
}
foreach (var kvp in parameters.PublishEnvironmentVariables)
{
PublishEnvironmentVariables.Add(kvp);
}
}
public ServerType ServerType { get; set; }
public RuntimeFlavor RuntimeFlavor { get; set; }