コード例 #1
0
        public void Should_translate_deeply_nested_select_expression()
        {
            Expression <Func <DeepStructuredObject, object> > expression = d =>
                                                                           new { d.Level0.Level1.Level2.FinalProperty };

            var expectedResults = new List <string>()
            {
                "Level0_Level1_Level2_FinalProperty"
            };

            var translated = AzureStorageQuerySelectTranslator.TranslateExpressionToMemberNames(expression,
                                                                                                _entityPropertyConverterOptions);

            for (var i = 0; i < translated.Count; i++)
            {
                translated[i].Should().Be(expectedResults[i]);
            }
        }
コード例 #2
0
        public void Should_translate_select_expression_2()
        {
            Expression <Func <UserProfile, object> > expression = profile =>
                                                                  new { RowKey = "", PartitionKey = "" };

            var expectedResults = new List <string>()
            {
                "RowKey",
                "PartitionKey"
            };

            var translated = AzureStorageQuerySelectTranslator.TranslateExpressionToMemberNames(expression,
                                                                                                _entityPropertyConverterOptions);

            for (var i = 0; i < translated.Count; i++)
            {
                translated[i].Should().Be(expectedResults[i]);
            }
        }
コード例 #3
0
        public void Should_translate_select_expression()
        {
            Expression <Func <UserProfile, object> > expression = profile =>
                                                                  new { profile.Name, profile.Age, profile.ExtendedProperties.HasVisitedBefore };

            var expectedResults = new List <string>()
            {
                "Name",
                "Age",
                "ExtendedProperties_HasVisitedBefore"
            };

            var translated = AzureStorageQuerySelectTranslator.TranslateExpressionToMemberNames(expression,
                                                                                                _entityPropertyConverterOptions);

            for (var i = 0; i < translated.Count; i++)
            {
                translated[i].Should().Be(expectedResults[i]);
            }
        }