@@ -184,7 +184,7 @@ private static void RegisterEvaluateHelper(IHandlebars handlebarsContext)
184184
185185 private static void RegisterCustomHelper ( IHandlebars handlebarsContext , HandlebarsHelpersOptions options , string categoryPrefix , IHelpers helper )
186186 {
187- Type helperClassType = helper . GetType ( ) ;
187+ var helperClassType = helper . GetType ( ) ;
188188
189189 var methods = helperClassType . GetMethods ( )
190190 . Select ( methodInfo => new
@@ -220,15 +220,16 @@ private static void RegisterCustomHelper(IHandlebars handlebarsContext, Handleba
220220 private static string GetName ( MethodInfo methodInfo , HandlebarsWriterAttribute attribute , HandlebarsHelpersOptions options , string categoryPrefix )
221221 {
222222 var names = new List < string > ( ) ;
223- if ( attribute . Name is { } && ! string . IsNullOrWhiteSpace ( attribute . Name ) )
223+ if ( ! string . IsNullOrWhiteSpace ( attribute . Name ) )
224224 {
225- names . Add ( attribute . Name ) ;
225+ var modifiedName = attribute . Name ! . Replace ( HandlebarsHelpersOptions . Dot , options . PrefixSeparator ) ;
226+ names . Add ( modifiedName ) ;
226227 }
227228 else
228229 {
229- if ( options . Prefix is { } && ! string . IsNullOrWhiteSpace ( options . Prefix ) )
230+ if ( ! string . IsNullOrWhiteSpace ( options . Prefix ) )
230231 {
231- names . Add ( options . Prefix ) ;
232+ names . Add ( options . Prefix ! ) ;
232233 }
233234
234235 if ( options . UseCategoryPrefix )
@@ -333,7 +334,7 @@ IHelperOptions options
333334 parameterCountRequired -- ;
334335 }
335336
336- if ( model is { } )
337+ if ( model != null )
337338 {
338339 numberOfArguments += 1 ;
339340 }
@@ -374,7 +375,7 @@ IHelperOptions options
374375 var parsedArguments = ArgumentsParser . Parse ( context , methodInfo . GetParameters ( ) , arguments ) ;
375376
376377 // Add null for optional arguments
377- for ( int i = 0 ; i < parameterCountAllowed . Max ( ) - numberOfArguments ; i ++ )
378+ for ( var i = 0 ; i < parameterCountAllowed . Max ( ) - numberOfArguments ; i ++ )
378379 {
379380 parsedArguments . Add ( null ) ;
380381 }
@@ -384,7 +385,7 @@ IHelperOptions options
384385 parsedArguments . Insert ( 0 , true ) ;
385386 }
386387
387- if ( model is { } )
388+ if ( model != null )
388389 {
389390 parsedArguments . Insert ( 0 , model ) ;
390391 }
@@ -416,6 +417,6 @@ IHelperOptions options
416417 /// </summary>
417418 private static string [ ] CreateHelperNames ( string helperName )
418419 {
419- return new [ ] { helperName , $ "[{ helperName } ]" } ;
420+ return [ helperName , $ "[{ helperName } ]"] ;
420421 }
421422}
0 commit comments