コード例 #1
0
        private void DoDistinct(FdoIConnection conn)
        {
            FdoISelectAggregates selectCmd = conn.CreateCommand((int)FdoCommandType.FdoCommandType_SelectAggregates) as FdoISelectAggregates;

            Assert.NotNull(selectCmd);
            selectCmd.SetFeatureClassName("World_Countries");
            selectCmd.Distinct = true;

            FdoIdentifierCollection propNames = selectCmd.GetPropertyNames();
            FdoIdentifier           ident     = FdoIdentifier.Create("NAME");

            propNames.Add(ident);

            FdoIDataReader   rdr    = selectCmd.Execute();
            HashSet <string> values = new HashSet <string>();

            int count = 0;

            while (rdr.ReadNext())
            {
                values.Add(rdr.GetString("NAME"));
                count++;
            }
            rdr.Close();
            Assert.Equal(values.Count, count);
        }
コード例 #2
0
        private static void ValidateIdentifier(FdoIdentifier expr, ClassDefinition cls)
        {
            string name = expr.Name;

            if (cls.FindProperty(name) == null)
            {
                throw new FdoExpressionValidationException(string.Format(Strings.InvalidExpressionPropertyNotFound, name), name);
            }
        }
コード例 #3
0
 protected abstract string TryTranslateIdentifier(FdoIdentifier ident, string featureVar);
コード例 #4
0
 protected override string TryTranslateIdentifier(FdoIdentifier ident, string featureVar)
 => $"({featureVar}.get('{ident.Name}'))";
コード例 #5
0
 protected override string TryTranslateIdentifier(FdoIdentifier ident, string featureVar)
 => $"({featureVar}.properties.{ident.Name})";