зеркало из https://github.com/microsoft/Power-Fx.git
Implement missing GetColumnCapability in CdpDelegationInfo (#2698)
This commit is contained in:
Родитель
388d16a8ab
Коммит
6c9855ebd2
|
@ -1,6 +1,8 @@
|
|||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using System;
|
||||
|
||||
namespace Microsoft.PowerFx.Core.Entities
|
||||
{
|
||||
// Used by ServiceCapabilities.ToDelegationInfo for managing CDP x-ms-capabilities
|
||||
|
@ -8,8 +10,16 @@ namespace Microsoft.PowerFx.Core.Entities
|
|||
{
|
||||
public override ColumnCapabilitiesDefinition GetColumnCapability(string fieldName)
|
||||
{
|
||||
// We should never reach that point in CDP case
|
||||
throw new System.NotImplementedException();
|
||||
if (ColumnsCapabilities.TryGetValue(fieldName, out ColumnCapabilitiesBase columnCapabilitiesBase))
|
||||
{
|
||||
return columnCapabilitiesBase switch
|
||||
{
|
||||
ColumnCapabilities columnCapabilities => columnCapabilities.Definition,
|
||||
_ => throw new NotImplementedException($"{columnCapabilitiesBase.GetType().Name} not supported yet")
|
||||
};
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -34,7 +34,7 @@ namespace Microsoft.PowerFx.Core.Entities
|
|||
internal PagingCapabilities PagingCapabilities { get; init; }
|
||||
|
||||
// Defining per column capabilities
|
||||
internal IReadOnlyCollection<KeyValuePair<string, ColumnCapabilitiesBase>> ColumnsCapabilities { get; init; }
|
||||
internal IReadOnlyDictionary<string, ColumnCapabilitiesBase> ColumnsCapabilities { get; init; }
|
||||
|
||||
// Supports per record permission
|
||||
internal bool SupportsRecordPermission { get; init; }
|
||||
|
@ -94,6 +94,8 @@ namespace Microsoft.PowerFx.Core.Entities
|
|||
|
||||
private ColumnCapabilitiesDefinition _capabilities;
|
||||
|
||||
public ColumnCapabilitiesDefinition Definition => _capabilities;
|
||||
|
||||
// Those are default CDS filter supported functions
|
||||
// From // PowerApps-Client\src\Language\PowerFx.Dataverse.Parser\Importers\DataDescription\CdsCapabilities.cs
|
||||
public static readonly IEnumerable<DelegationOperator> DefaultFilterFunctionSupport = new DelegationOperator[]
|
||||
|
|
Загрузка…
Ссылка в новой задаче