示例#1
0
文件: DbCommand.cs 项目: isaveu/Devx
        public dynamic QuerySingle()
        {
            dynamic item = null;

            this.Data.Execute.ExecuteQuery(true, () =>
            {
                var autoMapper = new DynamicTypAutoMapper(this.Data);

                if (this.Data.Reader != null && this.Data.Reader.Read())
                {
                    item = autoMapper.AutoMap();
                }
            });

            return(item);
        }
示例#2
0
文件: DbCommand.cs 项目: isaveu/Devx
        public List <dynamic> Query()
        {
            List <dynamic> items = null;

            this.Data.Execute.ExecuteQuery(true, () =>
            {
                items = new List <dynamic>();

                var autoMapper = new DynamicTypAutoMapper(this.Data);

                if (this.Data.Reader != null)
                {
                    while (this.Data.Reader.Read())
                    {
                        var item = autoMapper.AutoMap();

                        items.Add(item);
                    }
                }
            });

            return(items);
        }