@@ -41,15 +41,16 @@ public string GetCode(MetadataTypes metadata)
4141 sb . AppendLine ( "ServerVersion: {0}" . Fmt ( metadata . Version ) ) ;
4242 sb . AppendLine ( "MakePartial: {0}" . Fmt ( Config . MakePartial ) ) ;
4343 sb . AppendLine ( "MakeVirtual: {0}" . Fmt ( Config . MakeVirtual ) ) ;
44+ sb . AppendLine ( "MakeDataContractsExtensible: {0}" . Fmt ( Config . MakeDataContractsExtensible ) ) ;
4445 sb . AppendLine ( "AddReturnMarker: {0}" . Fmt ( Config . AddReturnMarker ) ) ;
4546 sb . AppendLine ( "AddDescriptionAsComments: {0}" . Fmt ( Config . AddDescriptionAsComments ) ) ;
4647 sb . AppendLine ( "AddDataContractAttributes: {0}" . Fmt ( Config . AddDataContractAttributes ) ) ;
48+ sb . AppendLine ( "AddDataAnnotationAttributes: {0}" . Fmt ( Config . AddDataAnnotationAttributes ) ) ;
4749 sb . AppendLine ( "AddDefaultXmlNamespace: {0}" . Fmt ( Config . AddDefaultXmlNamespace ) ) ;
48- sb . AppendLine ( "MakeDataContractsExtensible: {0}" . Fmt ( Config . MakeDataContractsExtensible ) ) ;
4950 sb . AppendLine ( "AddIndexesToDataMembers: {0}" . Fmt ( Config . AddIndexesToDataMembers ) ) ;
50- sb . AppendLine ( "InitializeCollections: {0}" . Fmt ( Config . InitializeCollections ) ) ;
5151 sb . AppendLine ( "AddResponseStatus: {0}" . Fmt ( Config . AddResponseStatus ) ) ;
5252 sb . AppendLine ( "AddImplicitVersion: {0}" . Fmt ( Config . AddImplicitVersion ) ) ;
53+ sb . AppendLine ( "InitializeCollections: {0}" . Fmt ( Config . InitializeCollections ) ) ;
5354 sb . AppendLine ( "DefaultNamespaces: {0}" . Fmt ( Config . DefaultNamespaces . ToArray ( ) . Join ( ", " ) ) ) ;
5455 sb . AppendLine ( "*/" ) ;
5556 sb . AppendLine ( ) ;
@@ -84,15 +85,15 @@ public string GetCode(MetadataTypes metadata)
8485 ImplementsFn = ( ) => {
8586 if ( ! Config . AddReturnMarker
8687 && ! request . ReturnVoidMarker
87- && request . ReturnMarkerGenericArgs == null )
88+ && request . ReturnMarkerTypeName == null )
8889 return null ;
8990
9091 if ( request . ReturnVoidMarker )
9192 return "IReturnVoid" ;
92- if ( request . ReturnMarkerGenericArgs != null )
93- return Type ( "IReturn`1" , request . ReturnMarkerGenericArgs ) ;
93+ if ( request . ReturnMarkerTypeName != null )
94+ return Type ( "IReturn`1" , new [ ] { Type ( request . ReturnMarkerTypeName ) } ) ;
9495 return response != null
95- ? Type ( "IReturn`1" , new [ ] { response . Name } )
96+ ? Type ( "IReturn`1" , new [ ] { Type ( response . Name , response . GenericArgs ) } )
9697 : null ;
9798 } ,
9899 IsRequest = true ,
@@ -153,7 +154,7 @@ private string AppendType(ref StringBuilderWrapper sb, MetadataType type, string
153154 AppendDataContract ( sb , type . DataContract ) ;
154155
155156 var partial = Config . MakePartial ? "partial " : "" ;
156- sb . AppendLine ( "public {0}class {1}" . Fmt ( partial , type . Name . SafeToken ( ) ) ) ;
157+ sb . AppendLine ( "public {0}class {1}" . Fmt ( partial , Type ( type . Name , type . GenericArgs ) ) ) ;
157158
158159 //: BaseClass, Interfaces
159160 var inheritsList = new List < string > ( ) ;
@@ -204,7 +205,7 @@ private void AddConstuctor(StringBuilderWrapper sb, MetadataType type, CreateTyp
204205 sb . AppendLine ( ) ;
205206 }
206207
207- sb . AppendLine ( "public {0}()" . Fmt ( type . Name . SafeToken ( ) ) ) ;
208+ sb . AppendLine ( "public {0}()" . Fmt ( NameOnly ( type . Name ) ) ) ;
208209 sb . AppendLine ( "{" ) ;
209210 sb = sb . Indent ( ) ;
210211
@@ -329,6 +330,11 @@ public string TypeValue(string type, string value)
329330 return value ;
330331 }
331332
333+ public string Type ( MetadataTypeName typeName )
334+ {
335+ return Type ( typeName . Name , typeName . GenericArgs ) ;
336+ }
337+
332338 public string Type ( string type , string [ ] genericArgs )
333339 {
334340 if ( genericArgs != null )
@@ -368,6 +374,11 @@ private string TypeAlias(string type)
368374 return typeAlias ?? type . SafeToken ( ) ;
369375 }
370376
377+ public string NameOnly ( string type )
378+ {
379+ return type . SplitOnFirst ( '`' ) [ 0 ] . SafeToken ( ) ;
380+ }
381+
371382 public void AppendComments ( StringBuilderWrapper sb , string desc )
372383 {
373384 if ( desc == null ) return ;
0 commit comments