Class SentryQueryInfo<TMainTable>
Class holding TableInfos on behalf of a Sentry implementation. Subclasses contain 'typed' tableinfos (as properties/fields) and 'untyped' tableinfos in an array.
Inheritance
Inherited Members
Namespace: SuperOffice.CRM.Security
Assembly: SoDataBase.dll
Syntax
public abstract class SentryQueryInfo<TMainTable> : SentryQueryInfo, IEnumerable<TableInfo>, IEnumerable where TMainTable : TableInfo
Type Parameters
Name | Description |
---|---|
TMainTable |
Remarks
Each sentry holds an implementation of this class to deal with tables covered by the sentry.
Constructors
SentryQueryInfo(TMainTable, bool)
Constructors called by implementations, providing the main TableInfo.
Declaration
protected SentryQueryInfo(TMainTable mainTable, bool hasVisibleFor)
Parameters
Type | Name | Description |
---|---|---|
TMainTable | mainTable | Main TableInfo for the query. |
bool | hasVisibleFor | Do we care about visible for table? |
Remarks
Each sentry holds an implementation of this class to deal with tables covered by the sentry.
Properties
HasVisibleFor
Does this table have VisibleFor?
Declaration
public override bool HasVisibleFor { get; }
Property Value
Type | Description |
---|---|
bool |
Overrides
Remarks
Each sentry holds an implementation of this class to deal with tables covered by the sentry.
MainTable
Main table for the sentry.
Declaration
public TMainTable MainTable { get; }
Property Value
Type | Description |
---|---|
TMainTable |
Remarks
Each sentry holds an implementation of this class to deal with tables covered by the sentry.
ParentFields
Get the field thayt
Declaration
public override FieldInfo[] ParentFields { get; }
Property Value
Type | Description |
---|---|
FieldInfo[] |
Overrides
Remarks
Each sentry holds an implementation of this class to deal with tables covered by the sentry.
VisibleForTableInfo
Table info for the related VisibleFor table.
Declaration
public override VisibleForTableInfo VisibleForTableInfo { get; }
Property Value
Type | Description |
---|---|
VisibleForTableInfo |
Overrides
Remarks
Each sentry holds an implementation of this class to deal with tables covered by the sentry.
Methods
AnalyzeQuery(PrivateSelect)
Declaration
public override void AnalyzeQuery(PrivateSelect sql)
Parameters
Type | Name | Description |
---|---|---|
PrivateSelect | sql | Select statement to base the lookup on. |
Overrides
Remarks
Each sentry holds an implementation of this class to deal with tables covered by the sentry.
CanCoverTable(TableInfo)
Check if this is a table that can be covered. If so, add it to the list of covered tables.
Declaration
public override bool CanCoverTable(TableInfo table)
Parameters
Type | Name | Description |
---|---|---|
TableInfo | table | Information about the table to analyze. |
Returns
Type | Description |
---|---|
bool | True if this now is a table that can be covered. |
Overrides
Remarks
Each sentry holds an implementation of this class to deal with tables covered by the sentry.
GetEnumerator()
Enumerator looping over all the covered tables for a sentry.
Declaration
public override IEnumerator<TableInfo> GetEnumerator()
Returns
Type | Description |
---|---|
IEnumerator<TableInfo> | Enumerator looping over all the covered tables for a sentry. |
Overrides
Remarks
The first item returned is always the MainTable.
GetOwnerTableCandidates()
Class holding TableInfos on behalf of a Sentry implementation. Subclasses contain 'typed' tableinfos (as properties/fields) and 'untyped' tableinfos in an array.
Declaration
protected abstract TableInfo[] GetOwnerTableCandidates()
Returns
Type | Description |
---|---|
TableInfo[] |
Remarks
Each sentry holds an implementation of this class to deal with tables covered by the sentry.
GetTypedMembers()
Method that can be overridden to return additional typed instances of covered TableInfos. The default implementation returns an empty array.
Declaration
protected virtual TableInfo[] GetTypedMembers()
Returns
Type | Description |
---|---|
TableInfo[] |
Remarks
Each sentry holds an implementation of this class to deal with tables covered by the sentry.
GetUntypedMembers()
Abstract member that needs to be implemented by the base classes to expose TableInfos covered by the sentry that is not exposed by the MainTable or GetTypedMembers().
Declaration
protected abstract TableInfo[] GetUntypedMembers()
Returns
Type | Description |
---|---|
TableInfo[] |
Remarks
Each sentry holds an implementation of this class to deal with tables covered by the sentry.
ReplaceRelatedTableInstance(TableInfo, TableInfo, TableInfo[])
Class holding TableInfos on behalf of a Sentry implementation. Subclasses contain 'typed' tableinfos (as properties/fields) and 'untyped' tableinfos in an array.
Declaration
protected void ReplaceRelatedTableInstance(TableInfo original, TableInfo replacement, TableInfo[] collectionToWorkOn)
Parameters
Type | Name | Description |
---|---|---|
TableInfo | original | |
TableInfo | replacement | |
TableInfo[] | collectionToWorkOn |
Remarks
Each sentry holds an implementation of this class to deal with tables covered by the sentry.
UpdateRelatedTableInfo<T>(PrivateSelect, ref T)
Update a TableInfo to the instance of the appropriate related table.
Declaration
protected void UpdateRelatedTableInfo<T>(PrivateSelect sql, ref T relatedTableInfo) where T : TableInfo
Parameters
Type | Name | Description |
---|---|---|
PrivateSelect | sql | The Select statement to analyze. |
T | relatedTableInfo | Related TableInfo to update. |
Type Parameters
Name | Description |
---|---|
T | Type of TableInfo to update. |
Remarks
Each sentry holds an implementation of this class to deal with tables covered by the sentry.
UpdateTypedMembers(PrivateSelect)
Method called by the base class to force the implementation to update typed instances of TableInfo.
Declaration
protected virtual void UpdateTypedMembers(PrivateSelect sql)
Parameters
Type | Name | Description |
---|---|---|
PrivateSelect | sql | Query to use when updating the TableInfos. |
Remarks
Implementations should use UpdateRelatedTableInfo<T>(PrivateSelect, ref T) when updating the TableInfo.