Ejemplo n.º 1
0
        /// <summary>
        /// Gets a reference to a path type of the specified kind.
        /// </summary>
        /// <param name="kind">Primitive kind of the type reference being created.</param>
        /// <param name="isNullable">Flag specifying if the referenced type should be nullable.</param>
        /// <returns>A new primitive type reference.</returns>
        public IEdmPathTypeReference GetPathType(EdmPathTypeKind kind, bool isNullable)
        {
            IEdmPathType pathDefinition = this.GetPathType(kind);

            if (pathDefinition != null)
            {
                return(new EdmPathTypeReference(pathDefinition, isNullable));
            }
            else
            {
                throw new InvalidOperationException(Edm.Strings.EdmPath_UnexpectedKind);
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="EdmCoreModelPathType"/> class.
 /// </summary>
 /// <param name="pathKind">The path kind.</param>
 public EdmCoreModelPathType(EdmPathTypeKind pathKind)
 {
     Name     = pathKind.ToString();
     PathKind = pathKind;
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Gets path type by kind.
        /// </summary>
        /// <param name="kind">Kind of the path type.</param>
        /// <returns>Path type definition.</returns>
        public IEdmPathType GetPathType(EdmPathTypeKind kind)
        {
            EdmCoreModelPathType definition;

            return(pathTypesByKind.TryGetValue(kind, out definition) ? definition : null);
        }
Ejemplo n.º 4
0
 public void GetPathTypeKindShouldReturnCorrectPathTypeKind(string qualifiedName, EdmPathTypeKind kind)
 {
     Assert.Equal(kind, EdmCoreModel.Instance.GetPathTypeKind(qualifiedName));
 }