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); }
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); } }
protected abstract string TryTranslateIdentifier(FdoIdentifier ident, string featureVar);
protected override string TryTranslateIdentifier(FdoIdentifier ident, string featureVar) => $"({featureVar}.get('{ident.Name}'))";
protected override string TryTranslateIdentifier(FdoIdentifier ident, string featureVar) => $"({featureVar}.properties.{ident.Name})";