Esempio n. 1
0
        internal override void SetReadOnly()
        {
            if (!IsReadOnly &&
                (ToEndMember != null) &&
                (ToEndMember.RelationshipMultiplicity == RelationshipMultiplicity.One))
            {
                // Correct our nullability if the multiplicity of the target end has changed.
                TypeUsage = TypeUsage.ShallowCopy(Facet.Create(NullableFacetDescription, false));
            }

            base.SetReadOnly();
        }
        private static void UpdateSentinelValuesInFacets(ref TypeUsage typeUsage)
        {
            PrimitiveType edmType = (PrimitiveType)typeUsage.EdmType;

            if (edmType.PrimitiveTypeKind != PrimitiveTypeKind.String && edmType.PrimitiveTypeKind != PrimitiveTypeKind.Binary || !Helper.IsUnboundedFacetValue(typeUsage.Facets["MaxLength"]))
            {
                return;
            }
            typeUsage = typeUsage.ShallowCopy(new FacetValues()
            {
                MaxLength = (FacetValueContainer <int?>)Helper.GetFacet((IEnumerable <FacetDescription>)edmType.FacetDescriptions, "MaxLength").MaxValue
            });
        }