Class ItemEntityStore
Inherited Members
Namespace: DataWeb.Data.SqlServer
Assembly: DataWeb.Data.SqlServer.dll
Syntax
public abstract class ItemEntityStore
Constructors
ItemEntityStore(IUser, IAuthorizationService, ISqlHelper, ICacheService, IFileService)
Declaration
protected ItemEntityStore(IUser user, IAuthorizationService authorizationService, ISqlHelper sqlHelper, ICacheService cacheService, IFileService fileService)
Parameters
| Type | Name | Description |
|---|---|---|
| IUser | user | |
| IAuthorizationService | authorizationService | |
| ISqlHelper | sqlHelper | |
| ICacheService | cacheService | |
| IFileService | fileService |
Fields
authorizationService
Declaration
protected readonly IAuthorizationService authorizationService
Field Value
| Type | Description |
|---|---|
| IAuthorizationService |
cacheService
Declaration
protected readonly ICacheService cacheService
Field Value
| Type | Description |
|---|---|
| ICacheService |
fileService
Declaration
protected readonly IFileService fileService
Field Value
| Type | Description |
|---|---|
| IFileService |
sqlHelper
Declaration
protected readonly ISqlHelper sqlHelper
Field Value
| Type | Description |
|---|---|
| ISqlHelper |
user
Declaration
protected readonly IUser user
Field Value
| Type | Description |
|---|---|
| IUser |
Methods
FillItemsFileCodesAsync(IEnumerable<ItemEntity>, IEnumerable<Task<string>>, CancellationToken)
Populates the FileCode property of items from asynchronous file code retrieval tasks.
Declaration
public static Task FillItemsFileCodesAsync(IEnumerable<ItemEntity> items, IEnumerable<Task<string>> getFileTasks, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<ItemEntity> | items | The collection of items to populate. |
| IEnumerable<Task<string>> | getFileTasks | The collection of tasks that retrieve file codes, in the same order as |
| CancellationToken | cancellationToken | A token to cancel the asynchronous operation. |
Returns
| Type | Description |
|---|---|
| Task |
FillItemsFilesAsync(IEnumerable<ItemEntity>, IEnumerable<Task<File>>, CancellationToken)
Populates the File property of items from asynchronous file retrieval tasks.
Declaration
public static Task FillItemsFilesAsync(IEnumerable<ItemEntity> items, IEnumerable<Task<File>> getFileTasks, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<ItemEntity> | items | The collection of items to populate. |
| IEnumerable<Task<File>> | getFileTasks | The collection of tasks that retrieve files, in the same order as |
| CancellationToken | cancellationToken | A token to cancel the asynchronous operation. |
Returns
| Type | Description |
|---|---|
| Task |
GetFileAsync(ItemFileFilter, string[], string, string, CancellationToken)
Retrieves the first file matching the specified filter, or null if none is found.
Declaration
protected Task<File> GetFileAsync(ItemEntityStore.ItemFileFilter filter, string[] sectionFiles, string sectionFileData, string culture, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| ItemEntityStore.ItemFileFilter | filter | The file filter criteria. |
| string[] | sectionFiles | The section names containing file relationships. |
| string | sectionFileData | The section name for file data. |
| string | culture | The culture code for localization. |
| CancellationToken | cancellationToken | A token to cancel the asynchronous operation. |
Returns
| Type | Description |
|---|---|
| Task<File> |
GetFileCodeAsync(ItemFileFilter, string[], string, string, CancellationToken)
Retrieves the code of the first file matching the specified filter.
Declaration
protected Task<string> GetFileCodeAsync(ItemEntityStore.ItemFileFilter filter, string[] sectionFiles, string sectionFileData, string culture, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| ItemEntityStore.ItemFileFilter | filter | The file filter criteria. |
| string[] | sectionFiles | The section names containing file relationships. |
| string | sectionFileData | The section name for file data. |
| string | culture | The culture code for localization. |
| CancellationToken | cancellationToken | A token to cancel the asynchronous operation. |
Returns
| Type | Description |
|---|---|
| Task<string> | The file code, or an empty string if not found. |
GetFilesAsync(ItemFileFilter, string[], string, string, CancellationToken)
Retrieves a collection of files matching the specified filter.
Declaration
protected Task<IEnumerable<File>> GetFilesAsync(ItemEntityStore.ItemFileFilter filter, string[] sectionFiles, string sectionFileData, string culture, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| ItemEntityStore.ItemFileFilter | filter | The file filter criteria. |
| string[] | sectionFiles | The section names containing file relationships. |
| string | sectionFileData | The section name for file data. |
| string | culture | The culture code for localization. |
| CancellationToken | cancellationToken | A token to cancel the asynchronous operation. |
Returns
| Type | Description |
|---|---|
| Task<IEnumerable<File>> | A collection of File objects matching the filter. |
GetPermissionSetAsync(string, CancellationToken)
Retrieves a permission set by name for the current user.
Declaration
protected Task<PermissionSet> GetPermissionSetAsync(string permissionSetName = "Public_Default", CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | permissionSetName | The name of the permission set to retrieve. Defaults to "Public_Default". |
| CancellationToken | cancellationToken | A token to cancel the asynchronous operation. |
Returns
| Type | Description |
|---|---|
| Task<PermissionSet> | The PermissionSet for the specified name. |