/// <summary>Determines whether the specified object is equal to the current object.</summary> /// <param name="operand">Type: <see cref="System.Object" /> /// The object to compare with the current object.</param> /// <returns>Type: <see cref="System.Boolean" /> /// <b>true</b> if the specified object is equal to the current object; otherwise, <b>false</b>.</returns> public override bool Equals(object operand) { if (Object.Equals(operand, null)) { return(false); } if (operand.GetType() != typeof(IdentifierEntityAccessor)) { return(false); } IdentifierEntityAccessor accessor = (IdentifierEntityAccessor)operand; return((About != null ? About.Equals(accessor.About) : Object.Equals(accessor.About, null)) && (SourceExpression != null ? SourceExpression.Equals(accessor.SourceExpression) : Object.Equals(accessor.SourceExpression, null)) && (Source == accessor.Source) && (_entityAccessor.Equals(accessor._entityAccessor))); }
/// <summary>Visit an identifier entity accessor.</summary> /// <param name="entityAccessor">Identifier entity accessor to be visited.</param> protected override void VisitIdentifierEntityAccessor(IdentifierEntityAccessor entityAccessor) { Call predicateBind = new Call(MethodNames.Bind); predicateBind.Arguments.Add(new Alias(new Literal(Rdf.predicate), new Identifier(entityAccessor.About.Name + "_Predicate"))); Call objectBind = new Call(MethodNames.Bind); objectBind.Arguments.Add(new Alias(new Literal(Rdf.@object), new Identifier(entityAccessor.About.Name + "_Object"))); _injectedComponents.Add(predicateBind); _injectedComponents.Add(objectBind); VisitStrongEntityAccessor(entityAccessor.EntityAccessor); _injectedComponents.Clear(); }
/// <summary>Visit an identifier entity accessor.</summary> /// <param name="entityAccessor">Identifier entity accessor to be visited.</param> protected abstract void VisitIdentifierEntityAccessor(IdentifierEntityAccessor entityAccessor);
private void OverrideIdentifierSelector(StrongEntityAccessor entityAccessor) { IdentifierEntityAccessor identifierEntityAccessor = new IdentifierEntityAccessor(entityAccessor.About, entityAccessor); int indexOf = -1; if ((indexOf = _query.Elements.IndexOf(entityAccessor)) != -1) { _query.Elements.RemoveAt(indexOf); _query.Elements.Insert(indexOf, identifierEntityAccessor); } _query.Select.Clear(); _query.Select.Add(identifierEntityAccessor); _mainFromComponent = identifierEntityAccessor; }