4 - Changed DefaultConversion behavior: empty string is now considered
\r
5 a non succeeded conversion. It used to be considered successful returning false.
\r
7 This might be a breaking change!
\r
10 - Applied Brian Chan's patch fixing MR-282
\r
11 "Binding to a nested IList<> or not null nested List<> fails"
\r
13 - Applied Adam Tybor's patch fixing MR-289
\r
14 "Array Binding for Prototype Style Serialization"
\r
16 - Applied Adam Tybor's patch fixing MR-266
\r
17 "Fix for GetErrorSummary() throwing an KeyNotFoundException for SmartDispatch Controller and Binder"
\r
20 "Validators in a Chain - ValidateNonEmpty fails with BelongsTo"
\r
22 - Changed DefaultConverter behavior:
\r
24 -> If we are dealing with a primitive, non-null values will always
\r
25 set conversionSuceeded to true
\r
26 That's because the value was on the form, and the binder needs to set it
\r
28 -> If we are dealing with a nullable, the conversionSuceeded will be set to true
\r
29 if the nested conversion succeeds or if the input is different from null.
\r
31 - Fixed COMP-8: Converter is not able to deal with Nullables<>
\r
33 - Fixed COMP-6: Nullable boolean cannot be bound
\r
35 - Updated to check argument inheritance for conversions.
\r
37 - Resolved COMP-3: Add support for generic collections.
\r
39 - Fixed MR-164: Allow and Exclude property acts on all objects, in any depth.
\r
41 - Applied patch by Lee Henson fixing MR-179
\r
42 "Binder doesn't convert empty strings to null."
\r
44 - Fixed bug that wrongly defined empty strings as conversionSucceeded = false
\r
46 - Fixed COMP-1 "Binder fails on simple MonoRail binding, when using ASP.NET authentication"
\r
47 Now the TreeBuilder will add as a leaf entries starting with '.', or '[' or ']'
\r
49 - Applied patch from Ernst Naezer's fixing a situation where the prefix is composed
\r
50 like "node1.node2.node3"
\r
52 - Removed support for meta elements (as they were passed
\r
53 via get/form and that doesn't look very safe)
\r
55 - More test cases were added
\r
57 - Major refactoring on Graph design and interfaces. However there wasn't any big change
\r
58 on the DataBinder class itself.
\r
60 - Changed ConvertUtils to consider non successful an attempt to convert a null
\r
63 - Added a CanConvert and an additional Convert
\r
65 - Added check for duplicate fields in DataReaderAdapter.
\r
67 - DataReaderAdapter: Added support for TypeConverters
\r
69 - Added two events to IDataBinder:
\r
71 BinderHandler OnBeforeBinding;
\r
72 BinderHandler OnAfterBinding;
\r
74 - Changed to allow null inputs be passed to type converters
\r
76 - Changed ConvertUtils behavior. Now empty strings will be converted to null
\r
77 and conversionSucceeded = true. Also, string will be trimmed.
\r
79 - Introduced DataReaderAdapter which can be used to populate an object based
\r
80 on an IDataReader. The adapter does not take ownership of the reader
\r
84 DataBinder binder = new DataBinder();
\r
86 SqlConnection conn = new SqlConnection("Server=(local);initial catalog=mydatabase;Integrated Security=SSPI");
\r
90 SqlCommand cmd = new SqlCommand("select * from products", conn);
\r
92 using(IDataReader reader = cmd.ExecuteReader(CommandBehavior.CloseConnection))
\r
94 Product[] products = (Product[])
\r
95 binder.BindObject(typeof(Product[]), "ignored",
\r
96 new DataReaderAdapter(reader));
\r
100 Limitations: only simple properties can be bound. Nested properties are ignored.
\r
103 - IBinderTranslator: after introducing the DataReaderAdapter, it was necessary
\r
104 create the notion of translation. A translator takes the a property name and
\r
105 returns the key that the binder should look up in order to get the value to fill
\r
106 the property. The translator can also return null. In this case the binder will skip
\r
109 A translator is associated with a Binder instance (which I'm not quite sure is a good thing)
\r
113 DataBinder binder = new DataBinder(new ProductTranslator());
\r
115 SqlConnection conn = new SqlConnection("Server=(local);initial catalog=mydatabase;Integrated Security=SSPI");
\r
119 SqlCommand cmd = new SqlCommand("select nome, descricao from produtos", conn);
\r
121 using(IDataReader reader = cmd.ExecuteReader(CommandBehavior.CloseConnection))
\r
123 Product[] products = (Product[])
\r
124 binder.BindObject(typeof(Product[]), "ignored",
\r
125 new DataReaderAdapter(reader));
\r
130 public class ProductTranslator : IBinderTranslator
\r
132 public String Translate(Type instanceType, String paramName)
\r
134 if (paramName == "Name")
\r
136 return "nome"; // this is the db column name
\r
138 else if (paramName == "Address")
\r
140 return "address"; // this is the db column name
\r
151 - Fix conversion using TypeConverters. The Converter won't be invoked if
\r
154 - The binder was extracted from MonoRail code base.