Skip to content

Commit f077ab6

Browse files
author
richard.waspcroft@gmail.com
committed
added missing code from check-in (associated with enabling multiple iterate blocks)
1 parent 5be20ed commit f077ab6

File tree

2 files changed

+69
-0
lines changed

2 files changed

+69
-0
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
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+
}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
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+
}

0 commit comments

Comments
 (0)