diff --git a/Rest.Net/Rest.Net.csproj b/Rest.Net/Rest.Net.csproj
index 9a31045..6b5f2dd 100644
--- a/Rest.Net/Rest.Net.csproj
+++ b/Rest.Net/Rest.Net.csproj
@@ -17,7 +17,7 @@
MontoyaTech.Rest.Net
MontoyaTech.Rest.Net
True
- 1.5.4
+ 1.5.5
Logo_Symbol_Black_Outline.png
diff --git a/Rest.Net/RestCSharpClientGenerator.cs b/Rest.Net/RestCSharpClientGenerator.cs
index 73d264e..3406026 100644
--- a/Rest.Net/RestCSharpClientGenerator.cs
+++ b/Rest.Net/RestCSharpClientGenerator.cs
@@ -218,6 +218,26 @@ namespace MontoyaTech.Rest.Net
if (!property.IsSpecialName && property.GetSetMethod() != null && property.GetGetMethod() != null)
this.GenerateCSharpIncludedProperty(property, writer);
+ if (!type.IsEnum)
+ {
+ //Generate an empty constructor
+ writer.WriteBreak();
+ writer.WriteLine($"public {(newName != null ? newName.Name : type.Name)}() {{ }}");
+
+ //Generate a constructor to set all the fields/properties from an existing instance
+ writer.WriteBreak();
+ writer.WriteLine($"public {(newName != null ? newName.Name : type.Name)}({(newName != null ? newName.Name : type.Name)} instance)");
+ writer.WriteLine('{').Indent();
+
+ foreach (var field in fields)
+ writer.WriteLine($"this.{field.Name} = instance.{field.Name};");
+
+ foreach (var property in properties)
+ writer.WriteLine($"this.{property.Name} = instance.{property.Name};");
+
+ writer.Outdent().WriteLine('}');
+ }
+
//Generate C# for any types that belong to this one.
for (int i = 0; i < types.Count; i++)
if (types[i].DeclaringType == type)