public static ProjectionMapping Map(Expression node)
 {
     var mapper = new ProjectionMapper();
     mapper.Visit(node);
     return new ProjectionMapping
     {
         Constructor = mapper._constructor,
         Expression = node,
         Members = mapper._mappings
     };
 }
Пример #2
0
        private IBsonSerializer BuildNew(NewExpression node)
        {
            if (node.Type == typeof(DateTime))
            {
                return(DateTimeSerializer.UtcInstance);
            }

            var mapping = ProjectionMapper.Map(node);

            return(BuildProjectedSerializer(mapping));
        }
        public static ProjectionMapping Map(Expression node)
        {
            var mapper = new ProjectionMapper();

            mapper.Visit(node);
            return(new ProjectionMapping
            {
                Constructor = mapper._constructor,
                Expression = node,
                Members = mapper._mappings
            });
        }
Пример #4
0
        private IBsonSerializer BuildNew(NewExpression node)
        {
            var mapping = ProjectionMapper.Map(node);

            return(BuildProjectedSerializer(mapping));
        }
Пример #5
0
        protected IBsonSerializer BuildMemberInit(MemberInitExpression node)
        {
            var mapping = ProjectionMapper.Map(node);

            return(BuildProjectedSerializer(mapping));
        }