linq C# DynamoDB扫描/查询嵌套属性值不起作用

ecbunoof  于 2022-12-20  发布在  C#
关注(0)|答案(1)|浏览(132)

我研究了很多,但是,我找不到一种方法来扫描/查询嵌套属性。

public class Details
    {
        public string Code { get; set; }
        public Details Details { get; set; }
    }

        
        public class Details
        {
            public string Code { get; set; }

            public string ClientName { get; set; }
            public string RequestedBy { get; set; }
            public string CreateDate { get; set; }
        }

//这是我的扫描条件

List<ScanCondition> scanConditions = new List<ScanCondition>
            {
                new ScanCondition
                {
                    PropertyName = "Details.ClientName",
                    Operator = ScanOperator.Equal,
                    Values= new object [] { "CitiFinanace" }
                }
            };

//实际调用

await context.ScanAsync<T>(scanConditions, dynamoDBOperationConfig).GetRemainingAsync();

错误:属性不在存储中。

y3bcpkx1

y3bcpkx11#

AWS文档说明:


AWS SDK for .NET - ScanCondition Class
考虑到这一点,只需更换:

Values = new object [] { "CitiFinanace" }

签署人:

Values= new string [] { "CitiFinanace" }

相关问题