Sage.Integration.Northwind.Application.Entities.Email.Email.GetAll C# (CSharp) Method

GetAll() public method

public GetAll ( NorthwindConfig config, string whereExpression, System.Data.OleDb.OleDbParameter oleDbParameters ) : List
config NorthwindConfig
whereExpression string
oleDbParameters System.Data.OleDb.OleDbParameter
return List
        public override List<Identity> GetAll(NorthwindConfig config, string whereExpression, OleDbParameter[] oleDbParameters)
        {
            List<Identity> result = new List<Identity>();
            int recordCount = 0;
            Emails emailsDataset = new Emails();

            // get the first 11 rows of the changelog
            using (OleDbConnection connection = new OleDbConnection(config.ConnectionString))
            {
                CustomerEmailsTableAdapter tableAdapter;

                tableAdapter = new CustomerEmailsTableAdapter();

                tableAdapter.Connection = connection;

                if (string.IsNullOrEmpty(whereExpression))
                    recordCount = tableAdapter.Fill(emailsDataset.CustomerEmails);
                else
                    recordCount = tableAdapter.FillByWhereClause(emailsDataset.CustomerEmails, whereExpression, oleDbParameters);
            }

            foreach (Emails.CustomerEmailsRow row in emailsDataset.CustomerEmails.Rows)
            {
                // use where expression !!
                result.Add(new Identity(this.EntityName, row.ID.ToString()));
            }

            return result;
        }

Same methods

Email::GetAll ( NorthwindConfig config, string whereExpression, int startIndex, int count ) : List