2 using System.Reflection;
4 namespace Hammock.Attributes.Validation
9 public class BooleanToIntegerAttribute : ValidationAttribute
11 public override string TransformValue(PropertyInfo property, object value)
13 #if !Smartphone && !NETCF
15 return bool.TryParse(value.ToString(), out result)
17 : base.TransformValue(property, value);
21 var result = bool.Parse(value.ToString());
22 return result ? "1" : "0";
26 return base.TransformValue(property, value);