@@ -10,8 +10,8 @@ private FluentCollectionAttributeInfo(
1010 int builderStep ,
1111 string singularName ,
1212 string withItems ,
13- string withItem ,
14- string withZeroItems ,
13+ string ? withItem ,
14+ string ? withZeroItems ,
1515 LambdaBuilderInfo ? lambdaBuilderInfo )
1616 : base ( builderStep )
1717 {
@@ -26,8 +26,8 @@ private FluentCollectionAttributeInfo(
2626 internal string SingularName { get ; }
2727 internal string SingularNameInCamelCase { get ; }
2828 internal string WithItems { get ; }
29- internal string WithItem { get ; }
30- internal string WithZeroItems { get ; }
29+ internal string ? WithItem { get ; }
30+ internal string ? WithZeroItems { get ; }
3131 internal LambdaBuilderInfo ? LambdaBuilderInfo { get ; }
3232 internal override string FluentMethodName => WithItems ;
3333
@@ -36,12 +36,20 @@ internal static FluentCollectionAttributeInfo Create(
3636 string memberName ,
3737 LambdaBuilderInfo ? lambdaBuilderInfo )
3838 {
39- ( int builderStep , string singularName , string withItems , string withItem , string withZeroItems ) =
40- attributeData . GetConstructorArguments < int , string , string , string , string > ( ) ;
39+ ( int builderStep , string singularName , string withItems , string ? withItem , string ? withZeroItems ) =
40+ attributeData . GetConstructorArguments < int , string , string , string ? , string ? > ( ) ;
4141
4242 withItems = NameCreator . CreateName ( withItems , memberName , singularName ) ;
43- withItem = NameCreator . CreateName ( withItem , memberName , singularName ) ;
44- withZeroItems = NameCreator . CreateName ( withZeroItems , memberName , singularName ) ;
43+
44+ if ( withItem != null )
45+ {
46+ withItem = NameCreator . CreateName ( withItem , memberName , singularName ) ;
47+ }
48+
49+ if ( withZeroItems != null )
50+ {
51+ withZeroItems = NameCreator . CreateName ( withZeroItems , memberName , singularName ) ;
52+ }
4553
4654 return new FluentCollectionAttributeInfo (
4755 builderStep , singularName , withItems , withItem , withZeroItems , lambdaBuilderInfo ) ;
0 commit comments