Exemplo n.º 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();
 }
Exemplo n.º 2
0
 internal void InitBinding(DataTable table)
 {
     _binding = new ModelBinding(_type, table, _func);
 }
Exemplo n.º 3
0
 internal void InitBinding(IDataReader reader)
 {
     _binding = new ModelBinding(_type, reader, _func);
 }
Exemplo n.º 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));
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }