File tree Expand file tree Collapse file tree 4 files changed +20
-2
lines changed
Expand file tree Collapse file tree 4 files changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -64,6 +64,7 @@ public static string ConditionallyConvertPropertyNameToCamelCase(this ExportSett
6464 public static string CamelCaseFromAttribute ( this MemberInfo member , string regularName )
6565 {
6666 var attr = ConfigurationRepository . Instance . ForMember < TsTypedMemberAttributeBase > ( member ) ;
67+ if ( attr == null ) return regularName ;
6768 if ( attr . ShouldBeCamelCased ) return ConvertToCamelCase ( regularName ) ;
6869 return regularName ;
6970 }
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ namespace Reinforced.Typings
1111 /// <summary>
1212 /// Useful extensions for reflection
1313 /// </summary>
14- internal static class TypeExtensions
14+ public static class TypeExtensions
1515 {
1616 /// <summary>
1717 /// Determines is type derived from Nullable or not
Original file line number Diff line number Diff line change @@ -217,7 +217,21 @@ public string ResolveTypeName(Type t)
217217 }
218218 if ( t . IsEnumerable ( ) )
219219 {
220- return Cache ( t , ResolveTypeName ( t . IsArray ? t . GetElementType ( ) : t . GetArg ( ) ) + "[]" ) ;
220+ if ( t . IsArray )
221+ {
222+ return Cache ( t , ResolveTypeName ( t . GetElementType ( ) ) + "[]" ) ;
223+ }
224+ else
225+ {
226+ var enumerable = t . GetInterfaces ( ) . FirstOrDefault ( c => c . IsGenericType && c . GetGenericTypeDefinition ( ) == typeof ( IEnumerable < > ) ) ;
227+ if ( enumerable == null )
228+ {
229+ if ( t . IsGenericType && t . GetGenericTypeDefinition ( ) == typeof ( IEnumerable < > ) ) enumerable = t ;
230+ }
231+ if ( enumerable == null ) return Cache ( t , "any[]" ) ;
232+ return Cache ( t , ResolveTypeName ( enumerable . GetArg ( ) ) + "[]" ) ;
233+ }
234+
221235 }
222236
223237 if ( t . IsGenericParameter )
Original file line number Diff line number Diff line change 1919 * 1.0.5
2020 * * Fluent configuration.
2121 * * Added more XMLDOC documentation.
22+ * * Ability to generate documentation from several sources (supported only with fluent configuration)
23+ * * camelCase for selected type members
24+ * * Minor bugfixes
2225 * 1.0.4
2326 * * Fixed invalid handling of IncludeNamespace parameter
2427 * * Fixed invalid interfaces extension
You can’t perform that action at this time.
0 commit comments