Interface IAppData
An App-DataSource which also provides direct commands to edit/update/delete data.
Inherited Members
Namespace: ToSic.Eav.Apps
Assembly: ToSic.Eav.Apps.dll
Syntax
[PublicApi_Stable_ForUseInYourCode]
public interface IAppData : IDataSource, IDataSourceLinkable, ICacheInfo, ICacheKey, ICanPurgeListCache, IHasLog, IDataTarget, IMetadataSource, ICacheExpiring, ITimestamped, IAppIdentity, IZoneIdentity, IAppIdentityLight
Methods
| Improve this Doc View SourceCreate(String, Dictionary<String, Object>, String, ITarget)
Create a new entity in the storage.
Declaration
IEntity Create(string contentTypeName, Dictionary<string, object> values, string userName = null, ITarget target = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | contentTypeName | The type name |
System.Collections.Generic.Dictionary<System.String, System.Object> | values | a dictionary of values to be stored |
System.String | userName | the current user name - will be logged as the author |
ITarget | target | information if this new item is to be metadata for something |
Returns
Type | Description |
---|---|
IEntity |
Remarks
Changed in 2sxc 10.30 - now returns the id of the created items
Create(String, IEnumerable<Dictionary<String, Object>>, String)
Create a bunch of new entities in one single call (much faster, because cache doesn't need to repopulate in the mean time).
Declaration
IEnumerable<IEntity> Create(string contentTypeName, IEnumerable<Dictionary<string, object>> multiValues, string userName = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | contentTypeName | The type name |
System.Collections.Generic.IEnumerable<System.Collections.Generic.Dictionary<System.String, System.Object>> | multiValues | many dictionaries, each will become an own item when stored |
System.String | userName | the current user name - will be logged as the author |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<IEntity> |
Remarks
You can't create items which are metadata with this, for that, please use the Create-one overload
Changed in 2sxc 10.30 - now returns the id of the created items
Delete(Int32, String)
Delete an existing item
Declaration
void Delete(int entityId, string userName = null)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | entityId | The item ID |
System.String | userName | the current user name - will be logged as the author of the change |
GetCustomMetadata<TKey>(TKey, String)
Get metadata of TargetType.Custom - which is the most common way your code will need Metadata.
Declaration
IEnumerable<IEntity> GetCustomMetadata<TKey>(TKey key, string contentTypeName = null)
Parameters
Type | Name | Description |
---|---|---|
TKey | key | The target identifier - a number, string or Guid |
System.String | contentTypeName | Optional name of Content-Type, if you only want items of a specific type |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<IEntity> |
Type Parameters
Name | Description |
---|---|
TKey | Key data type |
Update(Int32, Dictionary<String, Object>, String)
Update an existing item.
Declaration
void Update(int entityId, Dictionary<string, object> values, string userName = null)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | entityId | The item ID |
System.Collections.Generic.Dictionary<System.String, System.Object> | values | a dictionary of values to be updated |
System.String | userName | the current user name - will be logged as the author of the change |