1+ // Non-nullable member is uninitialized
2+ #pragma warning disable CS8618
3+ // ReSharper disable All
4+
5+ // Example from https://youtu.be/qCIr30WxJQw?si=FRALafrpA1zWACA8.
6+ // Implementation with arbitrary steps.
7+
8+ using M31 . FluentApi . Attributes ;
9+
10+ namespace ExampleProject ;
11+
12+ [ FluentApi ]
13+ public class Order2
14+ {
15+ [ FluentMember ( 0 ) ]
16+ [ FluentContinueWith ( 0 ) ]
17+ public int Number { get ; private set ; }
18+
19+ [ FluentMember ( 0 , "{Name}" ) ]
20+ [ FluentContinueWith ( 0 ) ]
21+ public DateTime CreatedOn { get ; private set ; }
22+
23+ [ FluentLambda ( 0 , "ShippedTo" ) ]
24+ [ FluentContinueWith ( 0 ) ]
25+ public Address2 ShippingAddress { get ; private set ; }
26+
27+ [ FluentMethod ( 0 ) ]
28+ private void Build ( )
29+ {
30+ }
31+ }
32+
33+ [ FluentApi ]
34+ public class Address2
35+ {
36+ [ FluentMember ( 0 , "{Name}" ) ]
37+ [ FluentContinueWith ( 0 ) ]
38+ public string Street { get ; private set ; }
39+
40+ [ FluentMember ( 0 , "{Name}" ) ]
41+ [ FluentContinueWith ( 0 ) ]
42+ public string City { get ; private set ; }
43+
44+ [ FluentMember ( 0 , "{Name}" ) ]
45+ [ FluentContinueWith ( 0 ) ]
46+ public string Zip { get ; private set ; }
47+
48+ [ FluentMember ( 0 , "{Name}" ) ]
49+ [ FluentContinueWith ( 0 ) ]
50+ public string State { get ; private set ; }
51+
52+ [ FluentMember ( 0 , "{Name}" ) ]
53+ [ FluentContinueWith ( 0 ) ]
54+ public string Country { get ; private set ; }
55+
56+ [ FluentMethod ( 0 ) ]
57+ private void Build ( )
58+ {
59+ State ??= "N/A" ;
60+ }
61+ }
0 commit comments