Esempio n. 1
0
        public void IndexAction(IMappedIdentifier entityId)
        {
            // Assume an ID is provided
            // From this, we need to request the relevant IContentResolver for the given entityId.MappedProvider
            // We then need to ask that IContentResolver for an entity with the given entityId.Value
            // (Ideally the Mediator would do all this for us by being given the entityId)
            // When asking for the entity, we decide whether to ask just for that entity in which
            // case we get an IContentEntity back, or we ask for a certain depth traversal in which
            // case we get an IContentVertex back (slower operation).
            // This is the DTO layer of the Synonym tier.
            // Then we map this to an IContentViewModel which is basically dynamic but includes the AttributeSchema for IntelliSense support

            //var mediator = new Mediator();
            //var contentEntityRepo = mediator.GetEntityRepositoryReader(entityId.MappedProvider);
            //var test = contentEntityRepo[a => a.WithId(new RepositoryGeneratedIdentifier())];
            //var test2 = contentEntityRepo.Filter(a => a.WithId(new RepositoryGeneratedIdentifier())).ToList();

            //var test3 = new List<IMappedIdentifier>();
            //test3.Where(a => a.ValueAsString = "test").ToList();
        }
 /// <summary>
 /// Adds an element with the provided key and value to the <see cref="TAllowedType:System.Collections.Generic.IDictionary`2"/>.
 /// </summary>
 /// <param name="key">The object to use as the key of the element to add.</param><param name="value">The object to use as the value of the element to add.</param><exception cref="TAllowedType:System.ArgumentNullException"><paramref name="key"/> is null.</exception><exception cref="TAllowedType:System.ArgumentException">An element with the same key already exists in the <see cref="TAllowedType:System.Collections.Generic.IDictionary`2"/>.</exception><exception cref="TAllowedType:System.NotSupportedException">The <see cref="TAllowedType:System.Collections.Generic.IDictionary`2"/> is read-only.</exception>
 public void Add(IMappedIdentifier key, TEntity value)
 {
     base.Dictionary.Add(key, value);
 }
 /// <summary>
 /// Gets the value associated with the specified key.
 /// </summary>
 /// <returns>
 /// true if the object that implements <see cref="TAllowedType:System.Collections.Generic.IDictionary`2"/> contains an element with the specified key; otherwise, false.
 /// </returns>
 /// <param name="key">The key whose value to get.</param><param name="value">When this method returns, the value associated with the specified key, if the key is found; otherwise, the default value for the type of the <paramref name="value"/> parameter. This parameter is passed uninitialized.</param><exception cref="TAllowedType:System.ArgumentNullException"><paramref name="key"/> is null.</exception>
 public bool TryGetValue(IMappedIdentifier key, out TEntity value)
 {
     return(base.Dictionary.TryGetValue(key, out value));
 }
 public virtual IEnumerable<IEntity> GetDescendents(IMappedIdentifier forEntityIdentifier)
 {
     throw new NotImplementedException();
 }
 public IEntityCollection <IAttributeDefinition> GetDescendents(IMappedIdentifier forEntityIdentifier)
 {
     throw new NotImplementedException();
 }
 public InvalidEntityIdentifierException(IMappedIdentifier identifier, string message, Exception inner)
     : base(message, inner)
 {
     Id = identifier;
 }
 public virtual IEntity Get(IMappedIdentifier identifier, int traversalDepth)
 {
     throw new NotImplementedException();
 }
Esempio n. 8
0
 /// <summary>
 /// Gets all the descendents of the IEntity with the given identifier as a list.
 /// </summary>
 /// <param name="forEntityIdentifier">The ascendent entity identifier.</param>
 /// <returns></returns>
 public TypedEntityCollection <ContentViewData> GetDescendents(IMappedIdentifier forEntityIdentifier)
 {
     throw new NotImplementedException();
 }
Esempio n. 9
0
 /// <summary>
 /// Gets the specified IEntity.
 /// </summary>
 /// <param name="identifier">The identifier of the entity.</param>
 /// <remarks>By default, the implementation should not return ascendents or descendents.</remarks>
 /// <returns></returns>
 public ContentViewData Get(IMappedIdentifier identifier)
 {
     throw new NotImplementedException();
 }
 public InvalidEntityIdentifierException(IMappedIdentifier identifier)
     : this(identifier, string.Empty)
 {
 }
Esempio n. 11
0
 /// <summary>
 /// Gets the parent IEntity for the given identifier.
 /// </summary>
 /// <param name="forEntityIdentifier">For entity identifier.</param>
 /// <returns></returns>
 public Content GetParent(IMappedIdentifier forEntityIdentifier)
 {
     throw new NotImplementedException();
 }
 public InvalidEntityIdentifierException(IMappedIdentifier identifier, string message, Exception inner)
     : base(message, inner)
 {
     Id = identifier;
 }
 public InvalidEntityIdentifierException(IMappedIdentifier identifier, string message)
     : this(identifier, message, null)
 {
 }
 public IAttributeDefinition Get(IMappedIdentifier identifier, int traversalDepth)
 {
     throw new NotImplementedException();
 }
 public IEntitySynonymVertex<IContentVertex> Get(IMappedIdentifier identifier, int traversalDepth)
 {
     throw new NotImplementedException();
 }
Esempio n. 16
0
 /// <summary>
 /// Gets the specified IEntity, including descdendents, to a given depth.
 /// </summary>
 /// <param name="identifier">The identifier of the IEntity.</param>
 /// <param name="traversalDepth">The traversal depth.</param>
 /// <returns></returns>
 public Content Get(IMappedIdentifier identifier, int traversalDepth)
 {
     throw new NotImplementedException();
 }
 public InvalidEntityIdentifierException(IMappedIdentifier identifier, string message)
     : this(identifier, message, null)
 {
 }
Esempio n. 18
0
 /// <summary>
 /// Gets or sets the element with the specified key.
 /// </summary>
 /// <returns>
 /// The element with the specified key.
 /// </returns>
 /// <param name="key">The key of the element to get or set.</param><exception cref="TAllowedType:System.ArgumentNullException"><paramref name="key"/> is null.</exception><exception cref="TAllowedType:System.Collections.Generic.KeyNotFoundException">The property is retrieved and <paramref name="key"/> is not found.</exception><exception cref="TAllowedType:System.NotSupportedException">The property is set and the <see cref="TAllowedType:System.Collections.Generic.IDictionary`2"/> is read-only.</exception>
 public TEntity this[IMappedIdentifier key]
 {
     get { return(base[key]); }
     set { base.Dictionary[key] = value; }
 }
 public InvalidEntityIdentifierException(IMappedIdentifier identifier)
     : this(identifier, string.Empty)
 {
 }
Esempio n. 20
0
 public IEntitySynonymVertex <IContentVertex> Get(IMappedIdentifier identifier, int traversalDepth)
 {
     throw new NotImplementedException();
 }
 public virtual IEntity GetParent(IMappedIdentifier forEntityIdentifier)
 {
     throw new NotImplementedException();
 }
 /// <summary>
 /// Determines whether the <see cref="TAllowedType:System.Collections.Generic.IDictionary`2"/> contains an element with the specified key.
 /// </summary>
 /// <returns>
 /// true if the <see cref="TAllowedType:System.Collections.Generic.IDictionary`2"/> contains an element with the key; otherwise, false.
 /// </returns>
 /// <param name="key">The key to locate in the <see cref="TAllowedType:System.Collections.Generic.IDictionary`2"/>.</param><exception cref="TAllowedType:System.ArgumentNullException"><paramref name="key"/> is null.</exception>
 public bool ContainsKey(IMappedIdentifier key)
 {
     return(base.Contains(key));
 }
Esempio n. 23
0
 /// <summary>
 /// Indicates whether the current object is equal to another object of the same type.
 /// </summary>
 /// <returns>
 /// true if the current object is equal to the <paramref name="other"/> parameter; otherwise, false.
 /// </returns>
 /// <param name="other">An object to compare with this object.</param>
 public virtual bool Equals(IMappedIdentifier other)
 {
     if (other == null ) return false;
     if (other is string) return Equals(other.ToString());
     return Equals(other.ValueAsString);
 }
 public IAttributeDefinition GetParent(IMappedIdentifier forEntityIdentifier)
 {
     throw new NotImplementedException();
 }