[csharp-netcore]: Fixing the build issues (#3681)

* fix(csharp-netcore): Fixing the build issues

* fix(csharp-netcore): Fixing the build issues

* fix(csharp-netcore): Fixing the Pet project

* fix(csharp-netcore): help fixes
This commit is contained in:
Sai Giridhar P
2019-08-21 15:48:58 +05:30
committed by William Cheng
parent 10a310ef69
commit 94eb6860aa
8 changed files with 9 additions and 26 deletions

View File

@@ -65,7 +65,7 @@ public class CSharpNetCoreClientCodegen extends AbstractCSharpCodegen {
protected String modelDocPath = "docs/";
// Defines TargetFrameworkVersion in csproj files
protected String targetFramework = defaultFramework.dotNetFrameworkVersion;
protected String targetFramework = defaultFramework.name;
// Defines nuget identifiers for target framework
protected String targetFrameworkNuget = targetFramework;
@@ -470,7 +470,7 @@ public class CSharpNetCoreClientCodegen extends AbstractCSharpCodegen {
}
clientPackage = "Client";
String framework = (String) additionalProperties.getOrDefault(CodegenConstants.DOTNET_FRAMEWORK, defaultFramework.dotNetFrameworkVersion);
String framework = (String) additionalProperties.getOrDefault(CodegenConstants.DOTNET_FRAMEWORK, defaultFramework.name);
FrameworkStrategy strategy = defaultFramework;
for (FrameworkStrategy frameworkStrategy : frameworkStrategies) {
if (framework.equals(frameworkStrategy.name)) {
@@ -481,7 +481,7 @@ public class CSharpNetCoreClientCodegen extends AbstractCSharpCodegen {
strategy.configureAdditionalProperties(additionalProperties);
setTargetFrameworkNuget(strategy.getNugetFrameworkIdentifier());
setTargetFramework(strategy.dotNetFrameworkVersion);
setTargetFramework(strategy.name);
if (strategy != FrameworkStrategy.NETSTANDARD_2_0) {
LOGGER.warn("If using built-in templates-RestSharp only supports netstandard 2.0 or later.");
@@ -800,7 +800,7 @@ public class CSharpNetCoreClientCodegen extends AbstractCSharpCodegen {
}
protected void configureAdditionalProperties(final Map<String, Object> properties) {
properties.putIfAbsent(CodegenConstants.DOTNET_FRAMEWORK, this.dotNetFrameworkVersion);
properties.putIfAbsent(CodegenConstants.DOTNET_FRAMEWORK, this.name);
// not intended to be user-settable
properties.put(TARGET_FRAMEWORK_IDENTIFIER, this.getTargetFrameworkIdentifier());