File tree Expand file tree Collapse file tree 2 files changed +69
-0
lines changed
src/MyBatis.DataMapper/Model/Binding Expand file tree Collapse file tree 2 files changed +69
-0
lines changed Original file line number Diff line number Diff line change 1+ using System ;
2+ namespace MyBatis . DataMapper . Model . Binding
3+ {
4+ internal class BindingExpression
5+ {
6+ public string FullPropertyName ;
7+
8+ public string Name ;
9+
10+ public string PropertyName ;
11+
12+ public string Value ;
13+
14+ public BindingExpression ( )
15+ {
16+ }
17+
18+ public BindingExpression ( string name )
19+ {
20+ if ( string . IsNullOrEmpty ( name ) )
21+ throw new ArgumentNullException ( "name" ) ;
22+
23+ Name = name ;
24+ }
25+ }
26+ }
Original file line number Diff line number Diff line change 1+ using System ;
2+ using System . Text ;
3+
4+ namespace MyBatis . DataMapper . Model . Binding
5+ {
6+ internal class BindingReplacement
7+ {
8+ public string FullPropertyName ;
9+ public string Name ;
10+ public string Placeholder ;
11+ public string Value ;
12+
13+ public void Replace ( StringBuilder buffer )
14+ {
15+ if ( buffer == null )
16+ throw new ArgumentNullException ( "buffer" ) ;
17+
18+ var replacementValue = Value ;
19+
20+ if ( ! String . IsNullOrEmpty ( FullPropertyName ) )
21+ {
22+ replacementValue = FullPropertyName ;
23+ }
24+
25+ buffer . Replace ( Placeholder , replacementValue ) ;
26+ }
27+
28+ public void Replace ( ref string buffer )
29+ {
30+ if ( buffer == null )
31+ throw new ArgumentNullException ( "buffer" ) ;
32+
33+ var replacementValue = Value ;
34+
35+ if ( ! String . IsNullOrEmpty ( FullPropertyName ) )
36+ {
37+ replacementValue = FullPropertyName ;
38+ }
39+
40+ buffer = buffer . Replace ( Placeholder , replacementValue ) ;
41+ }
42+ }
43+ }
You can’t perform that action at this time.
0 commit comments