Skip to content

Commit e39ec92

Browse files
committed
Merge pull request #879 from shoatman/master
Updates to csharp model template to support inheritance
2 parents dee0948 + 5f1df9e commit e39ec92

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

modules/swagger-codegen/src/main/resources/csharp/model.mustache

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ namespace {{package}} {
1313
/// {{description}}
1414
/// </summary>
1515
[DataContract]
16-
public class {{classname}} {
16+
public class {{classname}}{{#parent}} : {{{parent}}}{{/parent}} {
1717
{{#vars}}
1818
{{#description}}/* {{{description}}} */{{/description}}
1919
[DataMember(Name="{{baseName}}", EmitDefaultValue=false)]
@@ -39,11 +39,11 @@ namespace {{package}} {
3939
/// Get the JSON string presentation of the object
4040
/// </summary>
4141
/// <returns>JSON string presentation of the object</returns>
42-
public string ToJson() {
42+
public {{#parent}} new {{/parent}}string ToJson() {
4343
return JsonConvert.SerializeObject(this, Formatting.Indented);
4444
}
4545

4646
}
4747
{{/model}}
4848
{{/models}}
49-
}
49+
}

0 commit comments

Comments
 (0)