Interface IResourceStore
The interface for a resource store implementation, which provides CRUD operations for resources.
Namespace: DataWeb.Localization
Assembly: DataWeb.Core.dll
Syntax
public interface IResourceStore
Properties
Name
Gets the name of the resource store.
Declaration
string Name { get; }
Property Value
Type | Description |
---|---|
string |
Methods
ConvertStringToStatus(string)
Converts the given string value to a resource status.
Declaration
ResourceStatus ConvertStringToStatus(string value)
Parameters
Type | Name | Description |
---|---|---|
string | value |
Returns
Type | Description |
---|---|
ResourceStatus |
DeserializeCultureItems(string)
Deserializes the culture items from the specified string value.
Declaration
List<Resource.CultureItem> DeserializeCultureItems(string value)
Parameters
Type | Name | Description |
---|---|---|
string | value | The string value to deserialize. |
Returns
Type | Description |
---|---|
List<Resource.CultureItem> | A list of Resource.CultureItem objects. |
GetDictionariesAsync(ResourceFilter, CancellationToken)
Gets the dictionaries that match the specified filter.
Declaration
Task<IEnumerable<Dictionary<string, object>>> GetDictionariesAsync(ResourceFilter filter, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
ResourceFilter | filter | The ResourceFilter to apply. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<IEnumerable<Dictionary<string, object>>> | An enumerable collection of resources. |
GetDictionaryAsync(ResourceFilter, CancellationToken)
Gets a dictionary that matches the specified filter.
Declaration
Task<Dictionary<string, object>> GetDictionaryAsync(ResourceFilter filter, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
ResourceFilter | filter | The ResourceFilter to apply. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<Dictionary<string, object>> | The resource that matches the specified filter. |
GetResourceAsync(ResourceFilter, CancellationToken)
Gets a resource that matches the specified filter.
Declaration
Task<Resource> GetResourceAsync(ResourceFilter filter, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
ResourceFilter | filter | The ResourceFilter to apply. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<Resource> | The resource that matches the specified filter. |
GetResourceContextsAsync(CancellationToken)
Gets the contexts for all resources.
Declaration
Task<IEnumerable<string>> GetResourceContextsAsync(CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<IEnumerable<string>> | An enumerable collection of context strings. |
GetResourceCountAsync(ResourceFilter, CancellationToken)
Gets the count of resources that match the specified filter.
Declaration
Task<long> GetResourceCountAsync(ResourceFilter filter, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
ResourceFilter | filter | The ResourceFilter to apply. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<long> | The count of resources that match the specified filter. |
GetResourcesAsync(ResourceFilter, CancellationToken)
Gets the resources that match the specified filter.
Declaration
Task<IEnumerable<Resource>> GetResourcesAsync(ResourceFilter filter, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
ResourceFilter | filter | The ResourceFilter to apply. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<IEnumerable<Resource>> | An enumerable collection of resources. |
RemoveAsync(string, CancellationToken)
Removes the resource with the specified Id.
Declaration
Task RemoveAsync(string id, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | id | The Id of the resource to remove. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task | A task representing the asynchronous operation. |
SetAsync(Resource, CancellationToken)
Sets the specified resource.
Declaration
Task SetAsync(Resource resource, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
Resource | resource | The Resource to set. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task | A task representing the asynchronous operation. |