Exemplo n.º 1
0
 public void AddItem(BracketedName alias, PropertyMap property, bool ascending)
 {
     _items.Add(new Item
     {
         Alias = alias,
         Property = property,
         Ascending = ascending,
     });
 }
Exemplo n.º 2
0
        public bool VisitPath(QueryContext context, PropertyInfo[] path, out BracketedName alias, out PropertyMap map)
        {
            var entity = EntityMap;
            alias = Alias;
            map = null;

            for (var i = 0; i < path.Length - 1; i++)
            {
                var prop = path[i];
                var item = JoinGroup.FindJoin(prop);
                if (item == null)
                {
                    var reference = entity.FindReferenceMap(prop);

                    if (reference == null)
                        return false;

                    item = JoinGroup.AddJoin(alias, context.NextAlias(), reference);
                }

                alias = item.ToAlias;
                entity = item.ReferenceMap.To;
            }

            var last = path[path.Length - 1];
            map = entity.FindPropertyMap(last) ?? entity.FindReferenceMap(last);

            return true;
        }