SAIF.Framework.Preferences overview¶
Documentation context: Packaged Component (NuGet)
SAIF.Framework.Preferences is a small, self-contained data-access library that persists per-user application/page preference blobs in a single Oracle table, USER_PREFERENCE. It consists of exactly two classes — the Preference DTO and the PreferenceData data-access class — and issues inline SQL directly rather than using the framework's standard business-object (clsBusinessBase/IBusinessCriteria) pattern.
Purpose¶
- Provide a data-access surface for reading a single preference blob (
GetPreferences), reading all preferences for a user (GetPreferencesForUser), and upserting/deleting a preference (SavePreferences). - Represent one saved preference record as a simple DTO (
Preference), carrying application name, page name, preference ID, and a deserialized key/value item dictionary. - Normalize and scope preference identity by application name, user ID (lower-cased), and optional page name.
- Serialize/deserialize the stored preference payload as JSON (
PREFERENCE_TEXT) usingJavaScriptSerializer. - Consumed by host applications, which supply their own
IDataPortalInfoexecution context; this library resolves no configuration or connection settings itself.
Responsibilities¶
- Read a single preference blob scoped by application, user, and optional page (
GetPreferences). - Read all preferences for a given user across all applications/pages (
GetPreferencesForUser). - Upsert or delete a preference row via a single entry point (
SavePreferences), which dispatches to internal insert, update, or delete logic based on existing-row state and whether the supplied preference text is empty.
Key components¶
Preference: Plain data-transfer object representing one saved preference record (PreferenceId,ApplicationName,Pagename,PreferenceItems).PreferenceData: The sole data-access class; reads and writesUSER_PREFERENCErows via inline Oracle SQL executed throughSqlHelper.ResultSetQueryandSqlHelper.ScalarQuery<T>.
Related documentation¶
- Index
- Architecture
- Dependencies
- Operations and processes
- Business rules
- Configuration
- Database tables
- SQL catalog
- API reference
Sources¶
SAIF.Framework.Preferences\Preference.csSAIF.Framework.Preferences\PreferenceData.csSAIF.Framework.Preferences\SAIF.Framework.Preferences.csproj