コード例 #1
0
 public PropertySetter(PropertyInfo property, Type type, string name, object reader, ModelBinding binding)
 {
     this.Reader = reader;
     _type       = type;
     Property    = property;
     _name       = name;
     Binding     = binding;
     CreateExpress();
 }
コード例 #2
0
 internal void InitBinding(DataTable table)
 {
     _binding = new ModelBinding(_type, table, _func);
 }
コード例 #3
0
 internal void InitBinding(IDataReader reader)
 {
     _binding = new ModelBinding(_type, reader, _func);
 }
コード例 #4
0
        /// <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));
        }
コード例 #5
0
        /// <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);
        }
コード例 #6
0
        /// <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);
        }