Exemplo n.º 1
0
        private DbExpression CreateMemberExpression(TranslationContext context, PropertyInfo property, DbExpression subaccess)
        {
            Type type = property.PropertyType;

            return(subaccess.GetOrSetChildren(property, () =>
            {
                DbExpression item = null;
                if (type.IsPrimary())
                {
                    item = new DbMemberExpression(property, subaccess);
                }
                else if (type.IsComplexCollection())
                {
                    item = new DbCollectionMemberExpression(context, property, subaccess);
                }
                else
                {
                    item = new DbObjectMemberExpression(context, property, subaccess);
                }
                return item;
            }));
        }