-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathChanges.txt
More file actions
188 lines (123 loc) · 6.13 KB
/
Changes.txt
File metadata and controls
188 lines (123 loc) · 6.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
2.5.0 (2010-12-10)
==================
- Updated to Validator 2.5.0 and Core 2.5.2 (Includes DP).
- Included .NET 4 binaries on the release package
1.1.1
==================
- Updated to Validator 1.1.1, Core 1.2 and DP 2.1.
1.1.0
==================
- Added support for DateTimeOffset per COMP-56
NOTE: Only supported on Mono 2.6.
- Applied patch to fix COMP-105
"DictionaryAdapter can't handle properties with the 'new' keyword"
- Applied patch from Mike Nichols fixing COMP-82
"Default Converter Refactoring Patch"
- Applied patch from Mike Nichols fixing COMP-81
"DataBinder Generic List More Eager Collection"
- Applied patch from Felix Gartsman fixing COMP-53
"Changed some TreeBuilder methods visibility to allow constructing nodes from more containers"
- Node: changed to use generic list
- JSCodeGenerator: changed not to duplicate the whole code content to display in error message (whoever thought this would be a good idea?)
Beta 2
======
- Fixed MR-383
"Databinding object with non-public constructor"
Added ability to create types with non-public constructors. Not sure I like it, but...
- Changed DefaultConversion behavior: empty string is now considered
a non succeeded conversion. It used to be considered successful returning false.
This might be a breaking change!
- Applied Brian Chan's patch fixing MR-282
"Binding to a nested IList<> or not null nested List<> fails"
- Applied Adam Tybor's patch fixing MR-289
"Array Binding for Prototype Style Serialization"
- Applied Adam Tybor's patch fixing MR-266
"Fix for GetErrorSummary() throwing an KeyNotFoundException for SmartDispatch Controller and Binder"
- Fixed COMP-27
"Validators in a Chain - ValidateNonEmpty fails with BelongsTo"
- Changed DefaultConverter behavior:
-> If we are dealing with a primitive, non-null values will always
set conversionSuceeded to true
That's because the value was on the form, and the binder needs to set it
-> If we are dealing with a nullable, the conversionSuceeded will be set to true
if the nested conversion succeeds or if the input is different from null.
- Fixed COMP-8: Converter is not able to deal with Nullables<>
- Fixed COMP-6: Nullable boolean cannot be bound
- Updated to check argument inheritance for conversions.
- Resolved COMP-3: Add support for generic collections.
- Fixed MR-164: Allow and Exclude property acts on all objects, in any depth.
- Applied patch by Lee Henson fixing MR-179
"Binder doesn't convert empty strings to null."
- Fixed bug that wrongly defined empty strings as conversionSucceeded = false
- Fixed COMP-1 "Binder fails on simple MonoRail binding, when using ASP.NET authentication"
Now the TreeBuilder will add as a leaf entries starting with '.', or '[' or ']'
- Applied patch from Ernst Naezer's fixing a situation where the prefix is composed
like "node1.node2.node3"
- Removed support for meta elements (as they were passed
via get/form and that doesn't look very safe)
- More test cases were added
- Major refactoring on Graph design and interfaces. However there wasn't any big change
on the DataBinder class itself.
- Changed ConvertUtils to consider non successful an attempt to convert a null
value to boolean
- Added a CanConvert and an additional Convert
- Added check for duplicate fields in DataReaderAdapter.
- DataReaderAdapter: Added support for TypeConverters
- Added two events to IDataBinder:
BinderHandler OnBeforeBinding;
BinderHandler OnAfterBinding;
- Changed to allow null inputs be passed to type converters
- Changed ConvertUtils behavior. Now empty strings will be converted to null
and conversionSucceeded = true. Also, string will be trimmed.
- Introduced DataReaderAdapter which can be used to populate an object based
on an IDataReader. The adapter does not take ownership of the reader
Example:
DataBinder binder = new DataBinder();
SqlConnection conn = new SqlConnection("Server=(local);initial catalog=mydatabase;Integrated Security=SSPI");
conn.Open();
SqlCommand cmd = new SqlCommand("select * from products", conn);
using(IDataReader reader = cmd.ExecuteReader(CommandBehavior.CloseConnection))
{
Product[] products = (Product[])
binder.BindObject(typeof(Product[]), "ignored",
new DataReaderAdapter(reader));
}
Limitations: only simple properties can be bound. Nested properties are ignored.
- IBinderTranslator: after introducing the DataReaderAdapter, it was necessary
create the notion of translation. A translator takes the a property name and
returns the key that the binder should look up in order to get the value to fill
the property. The translator can also return null. In this case the binder will skip
the property
A translator is associated with a Binder instance (which I'm not quite sure is a good thing)
Example:
DataBinder binder = new DataBinder(new ProductTranslator());
SqlConnection conn = new SqlConnection("Server=(local);initial catalog=mydatabase;Integrated Security=SSPI");
conn.Open();
SqlCommand cmd = new SqlCommand("select nome, descricao from produtos", conn);
using(IDataReader reader = cmd.ExecuteReader(CommandBehavior.CloseConnection))
{
Product[] products = (Product[])
binder.BindObject(typeof(Product[]), "ignored",
new DataReaderAdapter(reader));
}
...
public class ProductTranslator : IBinderTranslator
{
public String Translate(Type instanceType, String paramName)
{
if (paramName == "Name")
{
return "nome"; // this is the db column name
}
else if (paramName == "Address")
{
return "address"; // this is the db column name
}
return null;
}
}
Beta 1
======
- Fix conversion using TypeConverters. The Converter won't be invoked if
the input is null.
- The binder was extracted from MonoRail code base.