-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathIMetadataSource.cs
More file actions
40 lines (37 loc) · 2.07 KB
/
Copy pathIMetadataSource.cs
File metadata and controls
40 lines (37 loc) · 2.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
namespace ToSic.Eav.Metadata;
/// <summary>
/// For querying metadata from the data source.
/// Mainly used in the Store, Cache-Systems and Apps.
/// </summary>
/// <remarks>
/// * Was renamed from `IMetadataGet` to `IMetadataSource` in v20 to better reflect its purpose.
/// </remarks>
[InternalApi_DoNotUse_MayChangeWithoutNotice("this is just fyi")]
[ShowApiWhenReleased(ShowApiMode.Never)]
public interface IMetadataSource
{
/// <summary>
/// Get any metadata from the current data source (usually an app)
/// </summary>
/// <remarks>
/// It does not return metadata describing the source (app), but metadata stored in this app, describing something else.
/// </remarks>
/// <typeparam name="TKey">Key-Type used - string, int or guid</typeparam>
/// <param name="targetType">The type-id of the target we're accessing, like 10=cms-object, 4=entity</param>
/// <param name="key">The key which is used for lookup</param>
/// <param name="contentTypeName">Optional content-type name, to only retrieve metadata of that type</param>
/// <returns>A list (can be empty) of metadata items found for this target</returns>
IEnumerable<IEntity> GetMetadata<TKey>(int targetType, TKey key, string? contentTypeName = null);
/// <summary>
/// Get any metadata from the current data source (usually an app)
/// </summary>
/// <remarks>
/// It does not return metadata describing the source (app), but metadata stored in this app, describing something else.
/// </remarks>
/// <typeparam name="TKey">Key-Type used - string, int or guid</typeparam>
/// <param name="targetType">The TargetTypes constant of the target we're accessing, like TargetTypes.Entity</param>
/// <param name="key">The key which is used for lookup</param>
/// <param name="contentTypeName">Optional content-type name, to only retrieve metadata of that type</param>
/// <returns>A list (can be empty) of metadata items found for this target</returns>
IEnumerable<IEntity> GetMetadata<TKey>(TargetTypes targetType, TKey key, string? contentTypeName = null);
}