Show / Hide Table of Contents

Interface ISoDataLookup

ISoDataLookup is used by the sentry to figure out the values for a particular row. The row objects, the data reader and insert/update/delete commands implement this interface to provide the sentry with data.

Inherited Members
ISentryIgnorable.BeginIgnoreSentryCheck()
ISentryIgnorable.EndIgnoreSentryCheck()
ISentryIgnorable.IsSentryIgnored
Namespace: SuperOffice.CRM.Security
Assembly: SoDataBase.dll
Syntax
public interface ISoDataLookup : ISentryIgnorable

Methods

GetFieldValue(FieldInfo)

Get the value of a field

Declaration
object GetFieldValue(FieldInfo field)
Parameters
Type Name Description
FieldInfo field

Specification of a field

Returns
Type Description
Object

Field value, such as an int, DateTime, string ...

GetKnownFields()

Calculating rights for all tables and field potentially covered by a Sentry can be a huge waste. This method should return only-and-all FieldInfos actually present in the data object, so the Sentry can avoid calculating stuff that isn't needed

Declaration
List<FieldInfo> GetKnownFields()
Returns
Type Description
List<FieldInfo>

GetPersistedFieldValue(FieldInfo)

Get the persisted value of a field. One should always verify that the persisted value is known using the method IsPersistedFieldValueKnown(FieldInfo) prior to accessing it, as an exception might be thrown.

Declaration
object GetPersistedFieldValue(FieldInfo field)
Parameters
Type Name Description
FieldInfo field

Specification of a field

Returns
Type Description
Object

Field value, such as an int, DateTime, string ... Null can be returned if the value is not known.

Exceptions
Type Condition
SoNotImplementedException

Thrown if the object implementing the interface does not support it.
The corresponding IsPersistedFieldValueKnown(FieldInfo) should for such instances return false.

IsGhostField(FieldInfo)

Check if there is actually a valid value for the given field. If not, then this field is called a 'ghost'. This happens if a field is part of an outer join that missed, or if it is a tablerow that was fetched but did not actually find its data in the database.

Declaration
bool IsGhostField(FieldInfo field)
Parameters
Type Name Description
FieldInfo field

Specification of a field

Returns
Type Description
Boolean

True if the field is a 'ghost', i.e., if it has NO valid known value

IsPersistedFieldValueKnown(FieldInfo)

Check if the persisted value for a dield is known.

Declaration
bool IsPersistedFieldValueKnown(FieldInfo field)
Parameters
Type Name Description
FieldInfo field

Specification of a field

Returns
Type Description
Boolean

True if the value is known.

Extension Methods

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