public Join GetAsJoin()
        {
            var selected = SelectedItem?.Key;

            if (selected == null)
            {
                return(null);
            }
            var join = new ParsedSelection(selected, RecordType, RecordService).GetAsJoin();

            if (join.Joins.Any())
            {
                //if this is an nn relationship then ther will be a child join to the actual target
                var otherSideTarget = join.Joins.First();
                otherSideTarget.RootFilter = FilterConditions.GetAsFilter();
                var childJoins = Joins != null?Joins.GetAsJoins() : new Join[0];

                otherSideTarget.Joins = childJoins.ToList();
            }
            else
            {
                //else the join is to the target
                join.RootFilter = FilterConditions.GetAsFilter();
                var childJoins = Joins != null?Joins.GetAsJoins() : new Join[0];

                join.Joins = childJoins.ToList();
            }
            return(join);
        }
        public Join GetAsJoin()
        {
            var selected = SelectedItem?.Key;

            if (selected == null)
            {
                return(null);
            }
            Join join = new ParsedSelection(selected, RecordType, RecordService).GetAsJoin();

            join.RootFilter = FilterConditions.GetAsFilter();
            var childJoins = Joins != null?Joins.GetAsJoins() : new Join[0];

            join.Joins = childJoins.ToList();
            return(join);
        }