Class AddressRows
Contact and Person addresses Collection of AddressRow. Each element of the collection represents one row in the Address table.
Inheritance
Implements
Inherited Members
Namespace: SuperOffice.CRM.Rows
Assembly: SoDataBase.dll
Syntax
public class AddressRows : TableRowsBase, INestedPersist, IEnumerable<INestedPersist>, ISoCollection, INotifyCollectionChanged, IBindingList, IList, ICollection, IEnumerable
Remarks
Row collections can be created in several ways.
- Use the static CreateNew() method to create a new, empty collection. You can then add objects of type AddressRow to it, and use methods like Save to operate on the whole collection.
- You can create a (nested) AddressRows AddressRows.CustomSearch object to obtain a query pre-populated with the correct tableinfo and return fields. This query can be modified with restrictions, etc. Then, use the static GetFromCustomSearch(CustomSearch) method to apply the query to the database and obtain the result as a Rows object, with one item for each table row that matched your query.
- For each non-unique index defined for the table, there is a corresponding GetFromIdx method to make retrieving data via the indexes easy.
Properties
this[int]
Get a AddressRow given its index in the collection.
Declaration
public AddressRow this[int index] { get; }
Parameters
Type | Name | Description |
---|---|---|
int | index | Index of the AddressRow in the collection |
Property Value
Type | Description |
---|---|
AddressRow |
Remarks
Row collections can be created in several ways.
- Use the static CreateNew() method to create a new, empty collection. You can then add objects of type AddressRow to it, and use methods like Save to operate on the whole collection.
- You can create a (nested) AddressRows AddressRows.CustomSearch object to obtain a query pre-populated with the correct tableinfo and return fields. This query can be modified with restrictions, etc. Then, use the static GetFromCustomSearch(CustomSearch) method to apply the query to the database and obtain the result as a Rows object, with one item for each table row that matched your query.
- For each non-unique index defined for the table, there is a corresponding GetFromIdx method to make retrieving data via the indexes easy.
Methods
Add(AddressRow)
Add one AddressRow to the collection.
Declaration
public int Add(AddressRow row)
Parameters
Type | Name | Description |
---|---|---|
AddressRow | row | An instance of AddressRow to be added to the collection. |
Returns
Type | Description |
---|---|
int | The index of the added AddressRow. |
Remarks
Row collections can be created in several ways.
- Use the static CreateNew() method to create a new, empty collection. You can then add objects of type AddressRow to it, and use methods like Save to operate on the whole collection.
- You can create a (nested) AddressRows AddressRows.CustomSearch object to obtain a query pre-populated with the correct tableinfo and return fields. This query can be modified with restrictions, etc. Then, use the static GetFromCustomSearch(CustomSearch) method to apply the query to the database and obtain the result as a Rows object, with one item for each table row that matched your query.
- For each non-unique index defined for the table, there is a corresponding GetFromIdx method to make retrieving data via the indexes easy.
AddNew()
Add a new instance of AddressRow added to the collection.
Declaration
public AddressRow AddNew()
Returns
Type | Description |
---|---|
AddressRow | A new instance of AddressRow added to the collection. |
Remarks
Row collections can be created in several ways.
- Use the static CreateNew() method to create a new, empty collection. You can then add objects of type AddressRow to it, and use methods like Save to operate on the whole collection.
- You can create a (nested) AddressRows AddressRows.CustomSearch object to obtain a query pre-populated with the correct tableinfo and return fields. This query can be modified with restrictions, etc. Then, use the static GetFromCustomSearch(CustomSearch) method to apply the query to the database and obtain the result as a Rows object, with one item for each table row that matched your query.
- For each non-unique index defined for the table, there is a corresponding GetFromIdx method to make retrieving data via the indexes easy.
AddRange(IEnumerable<AddressRow>)
Add a range of AddressRow to the collection.
Declaration
public AddressRows AddRange(IEnumerable<AddressRow> rows)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<AddressRow> | rows |
Returns
Type | Description |
---|---|
AddressRows | The updated AddressRows collection object. |
Remarks
Row collections can be created in several ways.
- Use the static CreateNew() method to create a new, empty collection. You can then add objects of type AddressRow to it, and use methods like Save to operate on the whole collection.
- You can create a (nested) AddressRows AddressRows.CustomSearch object to obtain a query pre-populated with the correct tableinfo and return fields. This query can be modified with restrictions, etc. Then, use the static GetFromCustomSearch(CustomSearch) method to apply the query to the database and obtain the result as a Rows object, with one item for each table row that matched your query.
- For each non-unique index defined for the table, there is a corresponding GetFromIdx method to make retrieving data via the indexes easy.
CreateChild()
Create a new instance of AddressRow
Declaration
protected override TableRowBase CreateChild()
Returns
Type | Description |
---|---|
TableRowBase | New instance of AddressRow |
Overrides
Remarks
Row collections can be created in several ways.
- Use the static CreateNew() method to create a new, empty collection. You can then add objects of type AddressRow to it, and use methods like Save to operate on the whole collection.
- You can create a (nested) AddressRows AddressRows.CustomSearch object to obtain a query pre-populated with the correct tableinfo and return fields. This query can be modified with restrictions, etc. Then, use the static GetFromCustomSearch(CustomSearch) method to apply the query to the database and obtain the result as a Rows object, with one item for each table row that matched your query.
- For each non-unique index defined for the table, there is a corresponding GetFromIdx method to make retrieving data via the indexes easy.
CreateNew()
Create a new instance of the AddressRows object. This collection will contain no rows.
Declaration
public static AddressRows CreateNew()
Returns
Type | Description |
---|---|
AddressRows | A new instance of the AddressRows object. |
Remarks
Row collections can be created in several ways.
- Use the static CreateNew() method to create a new, empty collection. You can then add objects of type AddressRow to it, and use methods like Save to operate on the whole collection.
- You can create a (nested) AddressRows AddressRows.CustomSearch object to obtain a query pre-populated with the correct tableinfo and return fields. This query can be modified with restrictions, etc. Then, use the static GetFromCustomSearch(CustomSearch) method to apply the query to the database and obtain the result as a Rows object, with one item for each table row that matched your query.
- For each non-unique index defined for the table, there is a corresponding GetFromIdx method to make retrieving data via the indexes easy.
Find(Predicate<AddressRow>)
Apply the predicate to each element of the collection and return the first row that matches; if no match then return null
Declaration
public AddressRow Find(Predicate<AddressRow> condition)
Parameters
Type | Name | Description |
---|---|---|
Predicate<AddressRow> | condition |
Returns
Type | Description |
---|---|
AddressRow |
Remarks
Row collections can be created in several ways.
- Use the static CreateNew() method to create a new, empty collection. You can then add objects of type AddressRow to it, and use methods like Save to operate on the whole collection.
- You can create a (nested) AddressRows AddressRows.CustomSearch object to obtain a query pre-populated with the correct tableinfo and return fields. This query can be modified with restrictions, etc. Then, use the static GetFromCustomSearch(CustomSearch) method to apply the query to the database and obtain the result as a Rows object, with one item for each table row that matched your query.
- For each non-unique index defined for the table, there is a corresponding GetFromIdx method to make retrieving data via the indexes easy.
FindAll(Predicate<AddressRow>)
Return a new collection that contains only those elements that match the condition. Elements are shared, not clones! of the original collection
Declaration
public AddressRows FindAll(Predicate<AddressRow> condition)
Parameters
Type | Name | Description |
---|---|---|
Predicate<AddressRow> | condition |
Returns
Type | Description |
---|---|
AddressRows |
Remarks
Row collections can be created in several ways.
- Use the static CreateNew() method to create a new, empty collection. You can then add objects of type AddressRow to it, and use methods like Save to operate on the whole collection.
- You can create a (nested) AddressRows AddressRows.CustomSearch object to obtain a query pre-populated with the correct tableinfo and return fields. This query can be modified with restrictions, etc. Then, use the static GetFromCustomSearch(CustomSearch) method to apply the query to the database and obtain the result as a Rows object, with one item for each table row that matched your query.
- For each non-unique index defined for the table, there is a corresponding GetFromIdx method to make retrieving data via the indexes easy.
ForEach(Action<AddressRow>)
Method that iterates over all members and applies the action parameter to each of them
Declaration
public void ForEach(Action<AddressRow> whatToDo)
Parameters
Type | Name | Description |
---|---|---|
Action<AddressRow> | whatToDo |
Remarks
Row collections can be created in several ways.
- Use the static CreateNew() method to create a new, empty collection. You can then add objects of type AddressRow to it, and use methods like Save to operate on the whole collection.
- You can create a (nested) AddressRows AddressRows.CustomSearch object to obtain a query pre-populated with the correct tableinfo and return fields. This query can be modified with restrictions, etc. Then, use the static GetFromCustomSearch(CustomSearch) method to apply the query to the database and obtain the result as a Rows object, with one item for each table row that matched your query.
- For each non-unique index defined for the table, there is a corresponding GetFromIdx method to make retrieving data via the indexes easy.
GetFromCustomSearch(CustomSearch)
Create a new instance of the AddressRows object, and populate it with data from a custom search. If the search returns no results, an empty collection will be returned; if the result contains rows, a collection of AddressRow objects representing each row will be returned.
Declaration
public static AddressRows GetFromCustomSearch(AddressRows.CustomSearch query)
Parameters
Type | Name | Description |
---|---|---|
AddressRows.CustomSearch | query | The custom search to execute against the database |
Returns
Type | Description |
---|---|
AddressRows | A new instance of the AddressRows object, reflecting the result of the query. |
Remarks
Row collections can be created in several ways.
- Use the static CreateNew() method to create a new, empty collection. You can then add objects of type AddressRow to it, and use methods like Save to operate on the whole collection.
- You can create a (nested) AddressRows AddressRows.CustomSearch object to obtain a query pre-populated with the correct tableinfo and return fields. This query can be modified with restrictions, etc. Then, use the static GetFromCustomSearch(CustomSearch) method to apply the query to the database and obtain the result as a Rows object, with one item for each table row that matched your query.
- For each non-unique index defined for the table, there is a corresponding GetFromIdx method to make retrieving data via the indexes easy.
GetFromIdxOwnerId(int)
Create a new instance of the AddressRow object, by querying the database table via the index 'IOwner_idType_idx'. This method is intended to make it easy to use efficient queries that match a database index.
Declaration
public static AddressRows GetFromIdxOwnerId(int ownerId)
Parameters
Type | Name | Description |
---|---|---|
int | ownerId |
Returns
Type | Description |
---|---|
AddressRows | Row object that represents the result of the search. IsNew will be true if the query did not match any row in the table |
Remarks
This method represents one of the unique indexes on the Address table. Non-unique indexes have corresponding inner classes and methods in the AddressRows collection, since they may return more than one row.
GetFromIdxState(string)
Create a new instance of the AddressRow object, by querying the database table via the index 'IDXAddrState'. This method is intended to make it easy to use efficient queries that match a database index.
Declaration
public static AddressRows GetFromIdxState(string state)
Parameters
Type | Name | Description |
---|---|---|
string | state |
Returns
Type | Description |
---|---|
AddressRows | Row object that represents the result of the search. IsNew will be true if the query did not match any row in the table |
Remarks
This method represents one of the unique indexes on the Address table. Non-unique indexes have corresponding inner classes and methods in the AddressRows collection, since they may return more than one row.
GetFromIdxZipcode(string)
Create a new instance of the AddressRow object, by querying the database table via the index 'IDXAddrZip'. This method is intended to make it easy to use efficient queries that match a database index.
Declaration
public static AddressRows GetFromIdxZipcode(string zipcode)
Parameters
Type | Name | Description |
---|---|---|
string | zipcode |
Returns
Type | Description |
---|---|
AddressRows | Row object that represents the result of the search. IsNew will be true if the query did not match any row in the table |
Remarks
This method represents one of the unique indexes on the Address table. Non-unique indexes have corresponding inner classes and methods in the AddressRows collection, since they may return more than one row.
GetFromReader(SoDataReader, AddressTableInfo)
Create a new instance of the AddressRows object, and populate it with data from a reader. If the search returns no results, an empty collection will be returned; if the result contains rows, a collection of AddressRow objects representing each row will be returned.
Note that the internal logic starts by calling reader.Read(), which is correct if you hand the method the result of an ExecuteReader(), but if the reader has already been advanced one or more rows, the current row will be skipped and collection population will start with the next row.Declaration
public static AddressRows GetFromReader(SoDataReader reader, AddressTableInfo tableInfo)
Parameters
Type | Name | Description |
---|---|---|
SoDataReader | reader | SoDataReader positioned to a valid database row. |
AddressTableInfo | tableInfo | AddressTableInfo instance used in the query that is the source of the reader. The fields used from the reader will be those owned by this tableinfo object. |
Returns
Type | Description |
---|---|
AddressRows |
Remarks
Row collections can be created in several ways.
- Use the static CreateNew() method to create a new, empty collection. You can then add objects of type AddressRow to it, and use methods like Save to operate on the whole collection.
- You can create a (nested) AddressRows AddressRows.CustomSearch object to obtain a query pre-populated with the correct tableinfo and return fields. This query can be modified with restrictions, etc. Then, use the static GetFromCustomSearch(CustomSearch) method to apply the query to the database and obtain the result as a Rows object, with one item for each table row that matched your query.
- For each non-unique index defined for the table, there is a corresponding GetFromIdx method to make retrieving data via the indexes easy.
Remove(AddressRow)
Removes the given AddressRow from the collection
Declaration
public void Remove(AddressRow row)
Parameters
Type | Name | Description |
---|---|---|
AddressRow | row | the AddressRow to be removed |
Remarks
Row collections can be created in several ways.
- Use the static CreateNew() method to create a new, empty collection. You can then add objects of type AddressRow to it, and use methods like Save to operate on the whole collection.
- You can create a (nested) AddressRows AddressRows.CustomSearch object to obtain a query pre-populated with the correct tableinfo and return fields. This query can be modified with restrictions, etc. Then, use the static GetFromCustomSearch(CustomSearch) method to apply the query to the database and obtain the result as a Rows object, with one item for each table row that matched your query.
- For each non-unique index defined for the table, there is a corresponding GetFromIdx method to make retrieving data via the indexes easy.
ToArray()
Contact and Person addresses Collection of AddressRow. Each element of the collection represents one row in the Address table.
Declaration
public AddressRow[] ToArray()
Returns
Type | Description |
---|---|
AddressRow[] |
Remarks
Row collections can be created in several ways.
- Use the static CreateNew() method to create a new, empty collection. You can then add objects of type AddressRow to it, and use methods like Save to operate on the whole collection.
- You can create a (nested) AddressRows AddressRows.CustomSearch object to obtain a query pre-populated with the correct tableinfo and return fields. This query can be modified with restrictions, etc. Then, use the static GetFromCustomSearch(CustomSearch) method to apply the query to the database and obtain the result as a Rows object, with one item for each table row that matched your query.
- For each non-unique index defined for the table, there is a corresponding GetFromIdx method to make retrieving data via the indexes easy.
ToString()
For debugging: Number of members, and the first (up to) 5 items
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string |
Overrides
Remarks
Row collections can be created in several ways.
- Use the static CreateNew() method to create a new, empty collection. You can then add objects of type AddressRow to it, and use methods like Save to operate on the whole collection.
- You can create a (nested) AddressRows AddressRows.CustomSearch object to obtain a query pre-populated with the correct tableinfo and return fields. This query can be modified with restrictions, etc. Then, use the static GetFromCustomSearch(CustomSearch) method to apply the query to the database and obtain the result as a Rows object, with one item for each table row that matched your query.
- For each non-unique index defined for the table, there is a corresponding GetFromIdx method to make retrieving data via the indexes easy.