示例#1
0
        private void Process(
            IConventionEntityTypeBuilder entityTypeBuilder, MemberInfo navigationMemberInfo, Type targetClrType, InversePropertyAttribute attribute)
        {
            if (!entityTypeBuilder.CanAddNavigation(
                    navigationMemberInfo.GetSimpleMemberName(), fromDataAnnotation: true))
            {
                return;
            }

            var targetEntityTypeBuilder = ((InternalEntityTypeBuilder)entityTypeBuilder).GetTargetEntityTypeBuilder(
                targetClrType, navigationMemberInfo, ConfigurationSource.DataAnnotation);

            if (targetEntityTypeBuilder == null)
            {
                return;
            }

            ConfigureInverseNavigation(entityTypeBuilder, navigationMemberInfo, targetEntityTypeBuilder, attribute);
        }