public void SetValueFor(Object instance, string key, PropertyInfo property) { if (Scope.Input[key] == null) { return; } object result = ConversionUtil.ConvertTo(property.PropertyType, Scope.Input[key]); if (result != null) { property.SetValue(instance, result, null); } }
private static object ConvertKey(object instance, InjectEntityAttribute attribute) { if (Scope.Input[attribute.Name] == null) { return(null); } try { return(ConversionUtil.ConvertTo(attribute.IdType, Scope.Input[attribute.Name])); } catch (Exception e) { logger.Debug(string.Format("Failed to convert ID ({0}) for {1} to integer.", attribute.Name, instance), e); return(null); } }