src/EntityFramework/Core/Objects/Internal/PocoPropertyAccessorStrategy.cs
/// <summary>
///     We only get here if a navigation property getter returns null.  In this case, we try to set the
///     navigation property to some collection that will work.
/// </summary>
We only get here if a navigation property getter returns null.  In this case, we try to set the
navigation property to some collection that will work.
We only get here if a navigation property getter returns null . In this case we try to set the navigation property to some collection that will work .
private static Func<object> CreateCollectionCreateDelegate(Type navigationPropertyType, string propName)
        {
            var typeToInstantiate = EntityUtil.DetermineCollectionType(navigationPropertyType);
            if (typeToInstantiate == null)
            {
                throw new EntityException(
                    Strings.PocoEntityWrapper_UnableToMaterializeArbitaryNavPropType(propName, navigationPropertyType));
            }
            return Expression.Lambda<Func<object>>(
                DelegateFactory.GetNewExpressionForCollectionType(typeToInstantiate)).Compile();
        }
private static Func < object > CreateCollectionCreateDelegate ( Type navigationPropertyType , string propName ) { var typeToInstantiate = EntityUtil . DetermineCollectionType ( navigationPropertyType ) ; if ( typeToInstantiate == null ) { throw new EntityException ( Strings . PocoEntityWrapper_UnableToMaterializeArbitaryNavPropType ( propName , navigationPropertyType ) ) ; } return Expression . Lambda < Func < object > > ( DelegateFactory . GetNewExpressionForCollectionType ( typeToInstantiate ) ) . Compile ( ) ; }
We only get here if a navigation property getter returns null.
We only get here if a navigation property getter returns null .
navigationPropertyType
Type
propName
string