Preference¶
Preference is a plain data-transfer object representing one saved preference record — the application name, optional page name, preference ID, and deserialized key/value item dictionary. It carries no data-access behavior of its own; rows are populated into Preference instances by PreferenceData.GetPreferencesForUser.
Purpose¶
- Represent a single row retrieved from USER_PREFERENCE as a strongly-typed object for consumption by host applications.
Context¶
- Namespace:
SAIF.Framework.Preferences - Assembly/package:
SAIF.Framework.Preferences
Public members¶
| Member | Signature | Purpose |
|---|---|---|
PreferenceId |
public Decimal PreferenceId |
Holds the row's USER_PREFERENCE_SEQ_NUM primary-key value. |
ApplicationName |
public string ApplicationName |
Holds the application name (APP_NAME) that owns the preference. |
Pagename |
public string Pagename |
Holds the optional page name (PAGE_NAME) scoping the preference. |
PreferenceItems |
public Dictionary<string, string> PreferenceItems |
Holds the deserialized key/value pairs from the stored PREFERENCE_TEXT JSON payload. |
Preference() |
public Preference() |
Parameterless constructor; no additional initialization logic. |
Behavioral notes¶
PreferenceItemsis populated only byPreferenceData.GetPreferencesForUser, which deserializesPREFERENCE_TEXTviaJavaScriptSerializerwhen the stored text is non-empty; otherwise the dictionary is left in its default state.*- This type is used exclusively as an output/read model — no method on
Preferenceitself performs data access.*
Constraints and usage notes¶
- Fields are public and mutable; there is no encapsulation or validation logic on this type.
- Callers reading preferences for a single app/page (via
PreferenceData.GetPreferences) receive a rawstringrather than aPreferenceinstance;Preferenceobjects are only produced byGetPreferencesForUser.
Note: Statements marked with * were inferred from code structure, naming conventions, or contextual evidence where direct confirmation was not available in source artifacts.
Sources¶
- SAIF.Framework.Preferences\Preference.cs