예제 #1
0
        /// <summary>
        /// Return the canonical uri (the edit link) of the element.
        /// </summary>
        /// <param name="element">Element whose canonical uri need to be returned.</param>
        /// <returns>Return the canonical uri of the element.</returns>
        private Uri GetEntityEditLink(object element)
        {
            Debug.Assert(element != null, "element != null");
            ResourceType      resourceType = WebUtil.GetNonPrimitiveResourceType(this.Provider, element);
            EntityToSerialize entity       = EntityToSerialize.Create(element, resourceType, this.CurrentContainer, this.Provider, this.AbsoluteServiceUri);

            return(entity.SerializedKey.AbsoluteEditLink);
        }
예제 #2
0
 /// <summary>
 /// Wraps the entity in a structure which tracks its type and other information about it.
 /// </summary>
 /// <param name="entity">The entity to wrap.</param>
 /// <param name="resourceType">The type of the entity.</param>
 /// <returns>A structure containing the entity and some other information about it.</returns>
 private EntityToSerialize WrapEntity(object entity, ResourceType resourceType)
 {
     return(EntityToSerialize.Create(entity, resourceType, this.CurrentContainer, this.Provider, this.AbsoluteServiceUri));
 }