Show / Hide Table of Contents

Class FindErpProductProvider

Find products through a Quote Connector, either through the standard interface or by dispatching to a custom provider, if one is supplied.

Inheritance
object
FindErpProductProvider
Implements
IArchiveProvider
IArchiveProviderHasRows
IArchiveProviderHasColumns
IArchiveProviderHasEntities
Inherited Members
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
Namespace: SuperOffice.CRM.ArchiveLists
Assembly: SoDataBase.BusinessLogic.dll
Syntax
[ArchiveProvider("FindErpProduct", 1073741823)]
public class FindErpProductProvider : IArchiveProvider, IArchiveProviderHasRows, IArchiveProviderHasColumns, IArchiveProviderHasEntities
Remarks

The mandatory quoteAlternativeId or quoteId is used to look up the correct connection/connector. If the connector contains a provider called FindProductsXYZ, where XYZ is the same as the name specified in the connector's QuoteConnectorAttribute name, then that custom provider is called. Otherwise, the FindProduct method of the connector will be called and its results transformed into an archive provider result set.

From quoteAlternativeId or quoteId the currency of the sale will be derived and added as a ArchiveRestrictionInfo to the search provider. The restriction name will be 'currencyName'

Default restrictions will also be added: priceList/isActive, priceList/validFrom and priceList/validTo.

Constructors

FindErpProductProvider(string)

Construct wrapper and dispatch to correct real provider, based on whether a custom implementation is available or not

Declaration
public FindErpProductProvider(string context)
Parameters
Type Name Description
string context
Remarks

The mandatory quoteAlternativeId or quoteId is used to look up the correct connection/connector. If the connector contains a provider called FindProductsXYZ, where XYZ is the same as the name specified in the connector's QuoteConnectorAttribute name, then that custom provider is called. Otherwise, the FindProduct method of the connector will be called and its results transformed into an archive provider result set.

From quoteAlternativeId or quoteId the currency of the sale will be derived and added as a ArchiveRestrictionInfo to the search provider. The restriction name will be 'currencyName'

Default restrictions will also be added: priceList/isActive, priceList/validFrom and priceList/validTo.

Fields

ProviderName

Find products through a Quote Connector, either through the standard interface or by dispatching to a custom provider, if one is supplied.

Declaration
public const string ProviderName = "FindErpProduct"
Field Value
Type Description
string
Remarks

The mandatory quoteAlternativeId or quoteId is used to look up the correct connection/connector. If the connector contains a provider called FindProductsXYZ, where XYZ is the same as the name specified in the connector's QuoteConnectorAttribute name, then that custom provider is called. Otherwise, the FindProduct method of the connector will be called and its results transformed into an archive provider result set.

From quoteAlternativeId or quoteId the currency of the sale will be derived and added as a ArchiveRestrictionInfo to the search provider. The restriction name will be 'currencyName'

Default restrictions will also be added: priceList/isActive, priceList/validFrom and priceList/validTo.

QuoteAlternativeContext

Find products through a Quote Connector, either through the standard interface or by dispatching to a custom provider, if one is supplied.

Declaration
public const string QuoteAlternativeContext = "QuoteAlternativeId"
Field Value
Type Description
string
Remarks

The mandatory quoteAlternativeId or quoteId is used to look up the correct connection/connector. If the connector contains a provider called FindProductsXYZ, where XYZ is the same as the name specified in the connector's QuoteConnectorAttribute name, then that custom provider is called. Otherwise, the FindProduct method of the connector will be called and its results transformed into an archive provider result set.

From quoteAlternativeId or quoteId the currency of the sale will be derived and added as a ArchiveRestrictionInfo to the search provider. The restriction name will be 'currencyName'

Default restrictions will also be added: priceList/isActive, priceList/validFrom and priceList/validTo.

QuoteConnectionContext

Find products through a Quote Connector, either through the standard interface or by dispatching to a custom provider, if one is supplied.

Declaration
public const string QuoteConnectionContext = "QuoteConnectionId"
Field Value
Type Description
string
Remarks

The mandatory quoteAlternativeId or quoteId is used to look up the correct connection/connector. If the connector contains a provider called FindProductsXYZ, where XYZ is the same as the name specified in the connector's QuoteConnectorAttribute name, then that custom provider is called. Otherwise, the FindProduct method of the connector will be called and its results transformed into an archive provider result set.

From quoteAlternativeId or quoteId the currency of the sale will be derived and added as a ArchiveRestrictionInfo to the search provider. The restriction name will be 'currencyName'

Default restrictions will also be added: priceList/isActive, priceList/validFrom and priceList/validTo.

QuoteContext

Find products through a Quote Connector, either through the standard interface or by dispatching to a custom provider, if one is supplied.

Declaration
public const string QuoteContext = "QuoteId"
Field Value
Type Description
string
Remarks

The mandatory quoteAlternativeId or quoteId is used to look up the correct connection/connector. If the connector contains a provider called FindProductsXYZ, where XYZ is the same as the name specified in the connector's QuoteConnectorAttribute name, then that custom provider is called. Otherwise, the FindProduct method of the connector will be called and its results transformed into an archive provider result set.

From quoteAlternativeId or quoteId the currency of the sale will be derived and added as a ArchiveRestrictionInfo to the search provider. The restriction name will be 'currencyName'

Default restrictions will also be added: priceList/isActive, priceList/validFrom and priceList/validTo.

UserInputRestriction

Find products through a Quote Connector, either through the standard interface or by dispatching to a custom provider, if one is supplied.

Declaration
public const string UserInputRestriction = "userInput"
Field Value
Type Description
string
Remarks

The mandatory quoteAlternativeId or quoteId is used to look up the correct connection/connector. If the connector contains a provider called FindProductsXYZ, where XYZ is the same as the name specified in the connector's QuoteConnectorAttribute name, then that custom provider is called. Otherwise, the FindProduct method of the connector will be called and its results transformed into an archive provider result set.

From quoteAlternativeId or quoteId the currency of the sale will be derived and added as a ArchiveRestrictionInfo to the search provider. The restriction name will be 'currencyName'

Default restrictions will also be added: priceList/isActive, priceList/validFrom and priceList/validTo.

Methods

Close()

Call this method after the last desired row has been read; this gives the provider the chance to close and free any underlying queries

Declaration
public void Close()
Remarks

The mandatory quoteAlternativeId or quoteId is used to look up the correct connection/connector. If the connector contains a provider called FindProductsXYZ, where XYZ is the same as the name specified in the connector's QuoteConnectorAttribute name, then that custom provider is called. Otherwise, the FindProduct method of the connector will be called and its results transformed into an archive provider result set.

From quoteAlternativeId or quoteId the currency of the sale will be derived and added as a ArchiveRestrictionInfo to the search provider. The restriction name will be 'currencyName'

Default restrictions will also be added: priceList/isActive, priceList/validFrom and priceList/validTo.

GetAvailableColumns()

Get the list of columns handled by this provider

Declaration
public List<ArchiveColumnInfo> GetAvailableColumns()
Returns
Type Description
List<ArchiveColumnInfo>
Remarks

The mandatory quoteAlternativeId or quoteId is used to look up the correct connection/connector. If the connector contains a provider called FindProductsXYZ, where XYZ is the same as the name specified in the connector's QuoteConnectorAttribute name, then that custom provider is called. Otherwise, the FindProduct method of the connector will be called and its results transformed into an archive provider result set.

From quoteAlternativeId or quoteId the currency of the sale will be derived and added as a ArchiveRestrictionInfo to the search provider. The restriction name will be 'currencyName'

Default restrictions will also be added: priceList/isActive, priceList/validFrom and priceList/validTo.

GetAvailableEntities()

Get the list of entities supported by this provider

Declaration
public List<ArchiveRowTypeInfo> GetAvailableEntities()
Returns
Type Description
List<ArchiveRowTypeInfo>
Remarks

The mandatory quoteAlternativeId or quoteId is used to look up the correct connection/connector. If the connector contains a provider called FindProductsXYZ, where XYZ is the same as the name specified in the connector's QuoteConnectorAttribute name, then that custom provider is called. Otherwise, the FindProduct method of the connector will be called and its results transformed into an archive provider result set.

From quoteAlternativeId or quoteId the currency of the sale will be derived and added as a ArchiveRestrictionInfo to the search provider. The restriction name will be 'currencyName'

Default restrictions will also be added: priceList/isActive, priceList/validFrom and priceList/validTo.

GetReaderAsync(string, CancellationToken)

Start the reader and return an IDataReader (which, as we remember, also inherits IDataRecord for access to individual data fields). This provides an alternative, more generic and more standards-based interface to data. Use either GetRows or GetReader on any particular archive provider instance.

Declaration
public Task<DbDataReader> GetReaderAsync(string options, CancellationToken cancellationToken = default)
Parameters
Type Name Description
string options
CancellationToken cancellationToken
Returns
Type Description
Task<DbDataReader>
Remarks

The mandatory quoteAlternativeId or quoteId is used to look up the correct connection/connector. If the connector contains a provider called FindProductsXYZ, where XYZ is the same as the name specified in the connector's QuoteConnectorAttribute name, then that custom provider is called. Otherwise, the FindProduct method of the connector will be called and its results transformed into an archive provider result set.

From quoteAlternativeId or quoteId the currency of the sale will be derived and added as a ArchiveRestrictionInfo to the search provider. The restriction name will be 'currencyName'

Default restrictions will also be added: priceList/isActive, priceList/validFrom and priceList/validTo.

GetResultInformationAsync()

Get additional information about the result, such as row count or other optional items. This method should be called after GetRowsAsync(string, CancellationToken), but before Close.

Declaration
public Task<ArchiveResultInformation> GetResultInformationAsync()
Returns
Type Description
Task<ArchiveResultInformation>
Remarks

The mandatory quoteAlternativeId or quoteId is used to look up the correct connection/connector. If the connector contains a provider called FindProductsXYZ, where XYZ is the same as the name specified in the connector's QuoteConnectorAttribute name, then that custom provider is called. Otherwise, the FindProduct method of the connector will be called and its results transformed into an archive provider result set.

From quoteAlternativeId or quoteId the currency of the sale will be derived and added as a ArchiveRestrictionInfo to the search provider. The restriction name will be 'currencyName'

Default restrictions will also be added: priceList/isActive, priceList/validFrom and priceList/validTo.

GetRowsAsync(string, CancellationToken)

Start the query and return an iterator. The .Current property will be a valid ArchiveRow containing one row, as long as a previous call to .MoveNext returned true. This is the standard semantics for an iterator. Do remember to call Close afterwards, to clean up all resources.

Declaration
public IAsyncEnumerable<ArchiveRow> GetRowsAsync(string options, CancellationToken cancellationToken = default)
Parameters
Type Name Description
string options

A set of options, using the query string format (name=value&...). Can be null or empty.

OptionPurpose/effect
countrows=truePrepare to return a count of the full result set
Options set here may trigger additional, asynchronous processing that will prepare results for the GetInformation method, if possible.
CancellationToken cancellationToken
Returns
Type Description
IAsyncEnumerable<ArchiveRow>

An iterator, following the usual conventions. MoveNext will return false when there are no more rows, which can either be because the result set is exhausted, or because the page size has been reached

Remarks

You can use the await foreach keyword to iterate over rows, like this:

IArchiveProvider provider = ArchiveProviderFactory.Create("person");
// not shown - set desired columns, entities, restrictions, paging
await foreach( ArchiveRow row in provider.GetRowsAsync() )
{
	// process row here
}
provider.Close();

SetDesiredColumns(params string[])

Set which columns should actually be returned, must be a subset of the GetAvailableColumns result

Declaration
public void SetDesiredColumns(params string[] columnIds)
Parameters
Type Name Description
string[] columnIds

Array of column ID's representing the desired columns

Remarks

The mandatory quoteAlternativeId or quoteId is used to look up the correct connection/connector. If the connector contains a provider called FindProductsXYZ, where XYZ is the same as the name specified in the connector's QuoteConnectorAttribute name, then that custom provider is called. Otherwise, the FindProduct method of the connector will be called and its results transformed into an archive provider result set.

From quoteAlternativeId or quoteId the currency of the sale will be derived and added as a ArchiveRestrictionInfo to the search provider. The restriction name will be 'currencyName'

Default restrictions will also be added: priceList/isActive, priceList/validFrom and priceList/validTo.

SetDesiredEntities(params string[])

Find products through a Quote Connector, either through the standard interface or by dispatching to a custom provider, if one is supplied.

Declaration
public void SetDesiredEntities(params string[] entities)
Parameters
Type Name Description
string[] entities

Array of entity names, semantically equivalent to ArchiveEntityInfo.Name fields.

Remarks

The mandatory quoteAlternativeId or quoteId is used to look up the correct connection/connector. If the connector contains a provider called FindProductsXYZ, where XYZ is the same as the name specified in the connector's QuoteConnectorAttribute name, then that custom provider is called. Otherwise, the FindProduct method of the connector will be called and its results transformed into an archive provider result set.

From quoteAlternativeId or quoteId the currency of the sale will be derived and added as a ArchiveRestrictionInfo to the search provider. The restriction name will be 'currencyName'

Default restrictions will also be added: priceList/isActive, priceList/validFrom and priceList/validTo.

SetOrderBy(params ArchiveOrderByInfo[])

Find products through a Quote Connector, either through the standard interface or by dispatching to a custom provider, if one is supplied.

Declaration
public void SetOrderBy(params ArchiveOrderByInfo[] orderBy)
Parameters
Type Name Description
ArchiveOrderByInfo[] orderBy

Array of order by items

Remarks

The mandatory quoteAlternativeId or quoteId is used to look up the correct connection/connector. If the connector contains a provider called FindProductsXYZ, where XYZ is the same as the name specified in the connector's QuoteConnectorAttribute name, then that custom provider is called. Otherwise, the FindProduct method of the connector will be called and its results transformed into an archive provider result set.

From quoteAlternativeId or quoteId the currency of the sale will be derived and added as a ArchiveRestrictionInfo to the search provider. The restriction name will be 'currencyName'

Default restrictions will also be added: priceList/isActive, priceList/validFrom and priceList/validTo.

SetPagingInfo(int, int)

Set the paging properties of the provider. The default is to fetch page zero, of one thousand (1000) rows. A more reasonable page size is probably around 100. Note that the query processing strategy may change for very large pages (more than 1000) and give significantly longer response times. Performance is improved by setting the page size low, as long as you don't set it lower than what you realistically expect to need (fetching multiple pages is more expensive than fetching one).

Declaration
public void SetPagingInfo(int pageSize, int pageNumber)
Parameters
Type Name Description
int pageSize

Desired page size

int pageNumber

Desired page number to return

Remarks

The mandatory quoteAlternativeId or quoteId is used to look up the correct connection/connector. If the connector contains a provider called FindProductsXYZ, where XYZ is the same as the name specified in the connector's QuoteConnectorAttribute name, then that custom provider is called. Otherwise, the FindProduct method of the connector will be called and its results transformed into an archive provider result set.

From quoteAlternativeId or quoteId the currency of the sale will be derived and added as a ArchiveRestrictionInfo to the search provider. The restriction name will be 'currencyName'

Default restrictions will also be added: priceList/isActive, priceList/validFrom and priceList/validTo.

SetRestriction(params ArchiveRestrictionInfo[])

Set query restriction globally, supersedes previous restrictions

Declaration
public bool SetRestriction(params ArchiveRestrictionInfo[] restrictions)
Parameters
Type Name Description
ArchiveRestrictionInfo[] restrictions

Array of restrictions, with an implicit AND between them

Returns
Type Description
bool

true if at least one of the restrictions matched one of the available columns of the provider

Remarks

The mandatory quoteAlternativeId or quoteId is used to look up the correct connection/connector. If the connector contains a provider called FindProductsXYZ, where XYZ is the same as the name specified in the connector's QuoteConnectorAttribute name, then that custom provider is called. Otherwise, the FindProduct method of the connector will be called and its results transformed into an archive provider result set.

From quoteAlternativeId or quoteId the currency of the sale will be derived and added as a ArchiveRestrictionInfo to the search provider. The restriction name will be 'currencyName'

Default restrictions will also be added: priceList/isActive, priceList/validFrom and priceList/validTo.

Implements

IArchiveProvider
IArchiveProviderHasRows
IArchiveProviderHasColumns
IArchiveProviderHasEntities

Extension Methods

EnumUtil.MapEnums<From, To>(From)
Converters.MapEnums<From, To>(From)
IArchiverProviderHasRowsExtensions.GetRowsAsync(IArchiveProviderHasRows, CancellationToken)
© SuperOffice. All rights reserved.
SuperOffice |  Community |  Release Notes |  Privacy |  Site feedback |  Search Docs |  About Docs |  Contribute |  Back to top