Код: Выделить всё
Microsoft.AspNetCore.OData from "7.5.12" to "8.1.0"
Конфигурация модели или определение функции:
Код: Выделить всё
`FunctionConfiguration getInstances = builder.Function("GetDeploymentInstanceForPool")
Код: Выделить всё
.Returns();
Код: Выделить всё
getInstances.Parameter("DeploymentInstanceType");
Код: Выделить всё
getInstances.Parameter("PoolId");
Код: Выделить всё
getInstances.Parameter("ParentInstanceId");`
Код: Выделить всё
[HttpGet("odata/GetDeploymentInstanceForPool(DeploymentInstanceType={deploymentInstanceType},PoolId={poolId},ParentInstanceId={parentInstanceId})")] public async Task GetDeploymentInstanceForPool( [FromRoute] string deploymentInstanceType, [FromRoute] string poolId, [FromRoute] string parentInstanceId) {
До обновления odata/GetDeploymentInstanceForPool(DeploymentInstanceType='AXServiceFabricInstance',PoolId='{0}',ParentInstanceId=null) присвоит ParentInstanceId значение null
После обновления вызов API устанавливает для ParentInstanceId значение «Microsoft.OData.ODataNullValue».
Может пожалуйста, сообщите здесь, как решить эту проблему, поскольку мой вызов не работает, принимая «Microsoft.OData.ODataNullValue» вместо нулевого значения.
Пробовал
Вариант 1< /strong>
Код: Выделить всё
getInstances.Parameter("ParentInstanceId").Optional();
Вариант 2[/b]
Код: Выделить всё
getInstances.Parameter("ParentInstanceId").Optional().HasDefaultValue(null);
Вариант 3
Код: Выделить всё
getInstances.Parameter("ParentInstanceId").Optional().HasDefaultValue(null).Nullable = true;
Подробнее здесь: https://stackoverflow.com/questions/790 ... ue-instead