﻿{% assign skipComma = true -%}
{% if HasInheritance %}
{% assign parentProperties = BaseClass.AllProperties -%}
{% else %}
{% assign parentProperties = "" | empty -%}
{% endif %}

{% assign sortedProperties = AllProperties | sort: "Name" -%}
{% assign sortedParentProperties = parentProperties | sort: "Name" -%}

[Newtonsoft.Json.JsonConstructor]
{% if IsAbstract %}protected{% else %}public{% endif %} {{ClassName}}({% for property in sortedProperties -%}{% if skipComma -%}{% assign skipComma = false %}{% else %}, {% endif -%} {{ property.Type }} {{ property.Name | lowercamelcase }}{% endfor -%})
{% assign skipComma = true -%}
{% if HasInheritance -%}
    : base({% for property in sortedParentProperties -%}{% if skipComma -%}{% assign skipComma = false %}{% else %}, {% endif -%}{{ property.Name | lowercamelcase }}{% endfor -%})
{% endif -%}
{
{% for property in Properties -%}
    {{property.PropertyName}} = @{{property.Name | lowercamelcase}};
{% endfor -%}
}


Add @ symbol to constructor parameters
﻿{% assign skipComma = true -%}
{% if HasInheritance %}
{% assign parentProperties = BaseClass.AllProperties -%}
{% else %}
{% assign parentProperties = "" | empty -%}
{% endif %}

{% assign sortedProperties = AllProperties | sort: "Name" -%}
{% assign sortedParentProperties = parentProperties | sort: "Name" -%}

[Newtonsoft.Json.JsonConstructor]
{% if IsAbstract %}protected{% else %}public{% endif %} {{ClassName}}({% for property in sortedProperties -%}{% if skipComma -%}{% assign skipComma = false %}{% else %}, {% endif -%} {{ property.Type }} @{{ property.Name | lowercamelcase }}{% endfor -%})
{% assign skipComma = true -%}
{% if HasInheritance -%}
    : base({% for property in sortedParentProperties -%}{% if skipComma -%}{% assign skipComma = false %}{% else %}, {% endif -%}{{ property.Name | lowercamelcase }}{% endfor -%})
{% endif -%}
{
{% for property in Properties -%}
    {{property.PropertyName}} = @{{property.Name | lowercamelcase}};
{% endfor -%}
}