コード例 #1
0
        /// <summary>
        /// Gets the type of the specified property.
        /// </summary>
        /// <param name="property">The property.</param>
        /// <returns>The type.</returns>
        public string Type(EdmProperty property)
        {
            if (property == null)
            {
                throw new ArgumentNullException("property");
            }

            var clrType = property.PrimitiveType.ClrEquivalentType;
            var type    = StripQualifiers(CodeProvider.GetTypeOutput(new CodeTypeReference(clrType)));

            if (clrType.IsValueType && property.Nullable)
            {
                return(type + "?");
            }

            return(type);
        }