Esempio n. 1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="property"></param>
        /// <returns></returns>
        private bool IncludeFieldInFactoryMethod(EdmProperty property)
        {
            if (property.Nullable)
            {
                return(false);
            }

            if (PropertyEmitter.HasDefault(property))
            {
                return(false);
            }

            if (PropertyEmitter.GetGetterAccessibility(property) != MemberAttributes.Public &&
                PropertyEmitter.GetSetterAccessibility(property) != MemberAttributes.Public)
            {
                return(false);
            }

            return(true);
        }
Esempio n. 2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="property"></param>
        /// <returns></returns>
        private bool IncludeFieldInFactoryMethod(EdmProperty property)
        {
            if (property.Nullable)
            {
                return(false);
            }

            if (PropertyEmitter.HasDefault(property))
            {
                return(false);
            }

            if ((PropertyEmitter.GetGetterAccessibility(property) != MemberAttributes.Public &&
                 PropertyEmitter.GetSetterAccessibility(property) != MemberAttributes.Public) ||
                // declared in a sub type, but not setter accessbile from this type
                (Item != property.DeclaringType && PropertyEmitter.GetSetterAccessibility(property) == MemberAttributes.Private)
                )
            {
                return(false);
            }

            return(true);
        }