diff --git a/src/Microsoft.OData.Cli/GenerateCommand.cs b/src/Microsoft.OData.Cli/GenerateCommand.cs index 70972e50..d7ae6b3a 100644 --- a/src/Microsoft.OData.Cli/GenerateCommand.cs +++ b/src/Microsoft.OData.Cli/GenerateCommand.cs @@ -9,6 +9,7 @@ using System.CommandLine; using System.CommandLine.NamingConventionBinder; using System.IO; +using System.Linq; using System.Threading.Tasks; using Microsoft.Build.Evaluation; using Microsoft.OData.CodeGen.CodeGeneration; @@ -233,9 +234,9 @@ private async Task GenerateCodeForV4Clients(GenerateOptions generateOptions, ICo serviceConfigurationV4.NamespacePrefix = generateOptions.NamespacePrefix; serviceConfigurationV4.MakeTypesInternal = generateOptions.EnableInternal; serviceConfigurationV4.GenerateMultipleFiles = generateOptions.MultipleFiles; - serviceConfigurationV4.ExcludedSchemaTypes = generateOptions.ExcludedSchemaTypes; - serviceConfigurationV4.ExcludedBoundOperations = generateOptions.ExcludedBoundOperations; - serviceConfigurationV4.ExcludedOperationImports = generateOptions.ExcludedOperationImports; + serviceConfigurationV4.ExcludedSchemaTypes = generateOptions.ExcludedSchemaTypes?.Split(",").Select(type => type.Trim()).ToList(); + serviceConfigurationV4.ExcludedBoundOperations = generateOptions.ExcludedBoundOperations?.Split(",").Select(type => type.Trim()).ToList(); + serviceConfigurationV4.ExcludedOperationImports = generateOptions.ExcludedOperationImports?.Split(",").Select(type => type.Trim()).ToList(); serviceConfigurationV4.IgnoreUnexpectedElementsAndAttributes = generateOptions.IgnoreUnexpectedElements; serviceConfigurationV4.EnableNamingAlias = generateOptions.UpperCamelCase; serviceConfigurationV4.UseDataServiceCollection = generateOptions.EnableTracking; diff --git a/src/Microsoft.OData.Cli/GenerateOptions.cs b/src/Microsoft.OData.Cli/GenerateOptions.cs index 8c939334..e330008b 100644 --- a/src/Microsoft.OData.Cli/GenerateOptions.cs +++ b/src/Microsoft.OData.Cli/GenerateOptions.cs @@ -5,8 +5,6 @@ // //---------------------------------------------------------------------------- -using System.Collections.Generic; - namespace Microsoft.OData.Cli { /// @@ -63,17 +61,17 @@ public class GenerateOptions /// /// Comma-separated list of the names of operation imports to exclude from the generated code. Example: ExcludedOperationImport1,ExcludedOperationImport2. /// - public List ExcludedOperationImports { get; set; } + public string ExcludedOperationImports { get; set; } /// /// Comma-separated list of the names of bound operations to exclude from the generated code.Example: BoundOperation1,BoundOperation2. /// - public List ExcludedBoundOperations { get; set; } + public string ExcludedBoundOperations { get; set; } /// /// Comma-separated list of the names of entity types to exclude from the generated code.Example: EntityType1,EntityType2,EntityType3. /// - public List ExcludedSchemaTypes { get; set; } + public string ExcludedSchemaTypes { get; set; } /// /// This flag indicates whether to ignore unexpected elements and attributes in the metadata document and generate the client code if any.