Hide

YetaWF.DataProvider.File Package Documentation

Display
Print

YetaWF.DataProvider.FileDataProvider<KEYTYPE,OBJTYPE> Class

This template class implements record-based I/O using the installed file I/O provider and local/shared caching. The file data provider allows record-based I/O, similar to a SQL table and is a low-level data provider. It is used by application data providers and not by applications directly. The implementation details are hidden from the application and local/shared caching is used as appropriate, based on definitions in appsettings.json.

The file data provider should only be used with very small datasets.

Any class derived from FileDataProvider<KEYTYPE, OBJTYPE> is provided with a complete implementation of record-level I/O (browse, read, add, update, remove) accessing the defined dataset.

Namespace: YetaWF.DataProvider
Assembly: YetaWF.DataProvider.File

Inheritance

Syntax

public class FileDataProvider<KEYTYPE,OBJTYPE> : YetaWF.DataProvider.FileDataProviderBase,
    YetaWF.Core.DataProvider.IDataProvider<KEYTYPE,OBJTYPE>,
    System.IDisposable,
    YetaWF.Core.DataProvider.IDataProviderTransactions;

Constructors

PublicFileDataProvider<KEYTYPE,OBJTYPE>Constructor.

Properties

PublicBaseFolderThe full path of the folder where the data provider stores its data. The FileDataProvider.GetBaseFolder() method is used to define the full path.
PublicCacheableDefines whether the data is cacheable. This corresponds to the Cacheable parameter of the YetaWF.Core.DataProvider.DataProviderImpl.MakeDataProvider method.
PublicCalculatedPropertyCallbackAsyncAn optional callback which is called whenever an object is retrieved to update some properties.
PublicDatasetThe dataset provided to the YetaWF.Core.DataProvider.DataProviderImpl.MakeDataProvider method when the data provider was created.
PublicIdentityNameReturns the name of the property that represents the identity column.
PublicIdentitySeedThe initial value of the identity seed. The default value is defined by FileIdentityCount.IDENTITY_SEED, but this can be overridden by passing an optional IdentitySeed parameter to the YetaWF.Core.DataProvider.DataProviderImpl.MakeDataProvider method when the data provider is created.
PublicKey1NameReturns the name of the property that represents the primary key column.
PublicLoggingDefines whether logging is wanted for the data provider. The default value is false, but this can be overridden by passing an optional Logging parameter to the YetaWF.Core.DataProvider.DataProviderImpl.MakeDataProvider method when the data provider is created. This does not appear to be used at this time by this data provider.
PublicOptionsA dictionary of options and optional parameters as provided to the YetaWF.Core.DataProvider.DataProviderImpl.MakeDataProvider method when the data provider was created.
PublicPackageThe package implementing the data provider.
PublicSiteIdentityThe site identity provided to the YetaWF.Core.DataProvider.DataProviderImpl.MakeDataProvider method when the data provider was created. This may be 0 if no specific site is associated with the data provider.
PublicUseIdentityDefines whether the site identity SiteIdentity was provided to the YetaWF.Core.DataProvider.DataProviderImpl.MakeDataProvider method when the data provider was created.

Fields

PublicStaticInherited from YetaWF.DataProvider.FileDataProviderBaseExternalNameThe name of the file data provider. This name is used in appsettings.json to select the data provider.

Methods

PublicAbortTransactionAborts a transaction, abandoning all updates.
PublicAddAsyncAdds a new record.
PublicAddSiteDataAsyncAdds data for a new site.
PublicCommitTransactionAsyncCommits a transaction, saving all updates.
PublicDisposePerforms application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
PublicInherited from System.ObjectEqualsDetermines whether the specified object is equal to the current object.
PublicExportChunkAsyncExports data from the data provider.
ProtectedInherited from System.ObjectFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
PublicGetAsyncRetrieves the record with the specified primary key.
PublicGetBaseFolderReturns the full path of the folder where this data provider stores its data.
PublicInherited from System.ObjectGetHashCodeServes as the default hash function.
PublicGetListOfKeysAsyncGiven a base folder, returns a collection of primary key values for all records in the dataset.
PublicGetOneRecordAsyncRetrieves one record using filtering criteria.
PublicGetRecordsAsyncRetrieves a collection of records using filtering criteria with sorting, with support for paging.
PublicInherited from System.ObjectGetTypeGets the Type of the current instance.
PublicImportChunkAsyncImports data into the data provider.
PublicInstallModelAsyncInstalls all data models (files, tables, etc.) for the data provider.
PublicIsInstalledAsyncReturns whether the data provider is installed and available.
PublicLocalizeModelAsyncCalled to translate the data managed by the data provider to another language.
ProtectedInherited from System.ObjectMemberwiseCloneCreates a shallow copy of the current Object.
PublicStaticInherited from System.ObjectReferenceEqualsDetermines whether the specified Object instances are the same instance.
PublicRemoveAsyncRemoves an existing record with the specified primary key.
PublicRemoveRecordsAsyncRemoves records using filtering criteria.
PublicRemoveSiteDataAsyncRemoves data when a site is deleted.
PublicStartTransactionStarts a transaction that can be committed, saving all updates, or aborted to abandon all updates.
PublicSupportTransactionsUsed when creating a dataprovider whithin StartTransAction().
PublicInherited from System.ObjectToStringReturns a string that represents the current object.
PublicUninstallModelAsyncUninstalls all data models (files, tables, etc.) for the data provider.
PublicUpdateAsyncUpdates an existing record with the specified primary key.

See Also YetaWF.DataProvider.FileYetaWF.Core