コード例 #1
0
        public List <Cliente> GetAll()
        {
            List <Cliente> returnList = new List <Cliente>();
            Cliente        currentEntity;
            SqlDataReader  currentReader = null;

            try {
                currentReader = DatabaseHelper.ExecuteReader("Clientes_GetAll", null);
                if (currentReader.HasRows)
                {
                    while (currentReader.Read())
                    {
                        currentEntity = DataReaderToObject(currentReader);
                        returnList.Add(currentEntity);
                    }
                }
            } catch (Exception ex) {
                CustomLog.LogException(ex);
            }

            DatabaseHelper.CloseAndDisposeReader(ref currentReader);

            return(returnList);
        }