Skip to content

Commit

Permalink
Pump release 6.3.2
Browse files Browse the repository at this point in the history
  • Loading branch information
moh-hassan committed Mar 18, 2024
1 parent 6799ae7 commit a38b6c4
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 15 deletions.
12 changes: 6 additions & 6 deletions OData2Poco.Cli/Options.cs
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,12 @@ public static IEnumerable<Example> Examples
[Option("att-defs", HelpText = "Path of user defined attributes. File is a json format.")]
public string AtributeDefs { get; set; }

[Option("internal", HelpText = "Declare class as internal.")]
public bool IsInternal { get; set; }

[Option('R', "ctor", Default = Ctor.None, HelpText = "Add constructor to the class or record. Allowed values: none, full for generating Parameterized Constructor. Default value is 'none' for no constructor")]
public Ctor WithConstructor { get; set; }

//----------------------Action options
[Option('x', "metafile", HelpText = "Xml filename to save metadata.")]
public string MetaFilename { get; set; }
Expand All @@ -201,12 +207,6 @@ public static IEnumerable<Example> Examples
[Option('l', "list", HelpText = "List POCO classes to standard output.")]
public bool ListPoco { get; set; }

[Option("internal", HelpText = "Declare class as internal.")]
public bool TypeVisibility { get; set; }

[Option('R', "ctor", Default = Ctor.None, HelpText = "Add constructor to the class or record. Allowed values: none, full for generating Parameterized Constructor. Default value is 'none' for no constructor")]
public Ctor WithConstructor { get; set; }

public List<string> Errors { get; } = [];
}
#nullable restore
9 changes: 4 additions & 5 deletions OData2Poco.Tests/PocoClassGeneratorCsTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ public partial class Rectangle : Shape
public void Class_can_be_internal_or_public(bool visibility)
{
//Arrange
var setting = new PocoSetting { TypeVisibility = visibility };
var setting = new PocoSetting { IsInternal = visibility };
var ct = new ClassTemplate(1)
{
Name = "Customer",
Expand All @@ -552,10 +552,10 @@ public void Class_can_be_internal_or_public(bool visibility)
[Test]
[TestCase(true)]
[TestCase(false)]
public void Enum_can_be_internal_or_public(bool visibility)
public void Enum_can_be_internal_or_public(bool @internal)
{
//Arrange
var setting = new PocoSetting { TypeVisibility = visibility };
var setting = new PocoSetting { IsInternal = @internal };
var ct = new ClassTemplate(1)
{
Name = "Feature",
Expand All @@ -569,8 +569,7 @@ public void Enum_can_be_internal_or_public(bool visibility)
var sut = PocoClassGeneratorCs.GenerateCsPocoClass(gen, setting);
var code = sut.ClassToString(ct);
//Assert
var expected = visibility ? "internal enum Feature" : "public enum Feature";
var expected = @internal ? "internal enum Feature" : "public enum Feature";
Assert.That(code, Does.Contain(expected));
}

}
2 changes: 1 addition & 1 deletion OData2PocoLib/PocoClassGeneratorCs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ internal string ClassToString(ClassTemplate ent, bool includeNamespace = false)
{
FluentCsTextTemplate csTemplate = new(PocoSetting);
var comment = ent.GetComment();
var visibility = PocoSetting.TypeVisibility ? "internal" : "public";
var visibility = PocoSetting.IsInternal ? "internal" : "public";
if (comment.Length > 0)
{
csTemplate.PushIndent("\t").WriteLine("// " + ent.GetComment()).PopIndent();
Expand Down
2 changes: 1 addition & 1 deletion OData2PocoLib/PocoSetting.cs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public PocoSetting()
public bool UseFullName { get; set; }
public bool ShowWarning { get; set; }
public string AtributeDefs { get; set; }
public bool TypeVisibility { get; set; }
public bool IsInternal { get; set; }
public Ctor WithConstructor { get; set; }
public void Validate()
{
Expand Down
7 changes: 6 additions & 1 deletion ReleaseNotes.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# OData2Poco

## Version 6.3.0
## Version 6.3.2
**Release Date:** March 18, 2024
- Fix : Generate ParameterLess Constructor beside the Parameterized one to avoid compilation error CS7036 when class inherits parent.


## Version 6.3.1
**Release Date:** March 16, 2024

- New Feature: Generate Parameterized Constructor.
Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

#nuget version is only changed by RELEASE TAG
version: 6.4.0-dev-{build}
version: 6.3.2-dev-{build}

image: Visual Studio 2022

Expand Down

0 comments on commit a38b6c4

Please sign in to comment.