public PropertySetter(PropertyInfo property, Type type, string name, object reader, ModelBinding binding) { this.Reader = reader; _type = type; Property = property; _name = name; Binding = binding; CreateExpress(); }
internal void InitBinding(DataTable table) { _binding = new ModelBinding(_type, table, _func); }
internal void InitBinding(IDataReader reader) { _binding = new ModelBinding(_type, reader, _func); }
/// <summary> /// /// </summary> /// <param name="type"></param> /// <param name="row"></param> /// <param name="obj"></param> /// <param name="prefix"></param> /// <returns></returns> public static object ToModel(Type type, DataRow row, object obj, string prefix) { var binding = new ModelBinding(type, row, prefix); return(binding.Bind(obj)); }
/// <summary> /// 创建一个ModelBinding的方法 /// </summary> /// <param name="type">要填充的实体的Type</param> /// <param name="table">数据表DataTable</param> /// <param name="prefix">字段前缀</param> /// <returns>ModelBinding</returns> public static ModelBinding GetBinding(Type type, DataTable table, string prefix) { var binding = new ModelBinding(type, table, prefix); return(binding); }
/// <summary> /// 创建一个ModelBinding的方法 /// </summary> /// <param name="type">要填充的实体的Type</param> /// <param name="reader">IDataReader</param> /// <param name="prefix">字段前缀</param> /// <returns>ModelBinding</returns> public static ModelBinding GetBinding(Type type, IDataReader reader, string prefix) { var binding = new ModelBinding(type, reader, prefix); return(binding); }