Exemplo n.º 1
0
        /// <inheritdoc />
        public IEnumerable <TEntity> GetAll()
        {
            var returnList = new List <TEntity>();

            using (var con = sqlHelper.CreateConnection(this.connectionString))
            {
                var COMMAND = $"select * " +
                              $"from {typeof(TEntity).GetAttributeValue((DbTableAttribute dbTable) => dbTable.TableName)}";
                using (var rdr = sqlHelper.ExecuteReader(con, COMMAND))
                {
                    while (rdr.Read())
                    {
                        var art = this.Mapping(rdr);
                        returnList.Add(art);
                    }
                }
            }

            return(returnList);
        }