Пример #1
0
        public virtual StringBuilder BuildJoinClause(View view)
        {
            view.ThrowIfNullArgument(nameof(view));

            _str = new StringBuilder();
            Visit(view);
            _str.UnBracketing(StringPair.Parenthesis);
            return _str;
        }
Пример #2
0
 public MSSqlSchema()
 {
     _person = new View<Person>();
     _contactInfo = new View<ContactInfo>();
     _course = new View<Course>();
     _coursePerson = new View<CoursePerson>();
     _employee = new View<Employee>();
     _week = new View<Week>();
     _lifecycle = new View<Lifecycle>();
 }
Пример #3
0
        private void Visit(View view)
        {
            switch (view.ViewType)
            {
                case ViewType.Join:
                    Visit((JoinView)view);
                    break;

                case ViewType.Single:
                    Visit((SingleEntityView)view);
                    break;
            }
        }
Пример #4
0
        private void Visit(View view)
        {
            view.ViewType.ThrowIfEnumOutOfRange();
            switch (view.ViewType)
            {
                case ViewType.Single:
                    Visit(view as SingleEntityView);
                    return;

                case ViewType.Join:
                    Visit(view as JoinView);
                    return;
            }
        }
Пример #5
0
        protected JoinView(View left, JoinType joinType, View right, Expression joinKey)
        {
            left.ThrowIfNullArgument(nameof(left));
            right.ThrowIfNullArgument(nameof(right));
            joinType.ThrowIfEnumOutOfRange();
            joinKey.ThrowIfNullArgument(nameof(joinKey));

            _left = left;
            _right = right;
            _joinType = joinType;
            _joinKey = joinKey;

            this._viewType = ViewType.Join;
        }
Пример #6
0
        private void VisitViewAlias(View view)
        {
            view.ViewType.ThrowIfEnumOutOfRange();

            switch (view.ViewType)
            {
                case ViewType.Single:
                    VisitViewAlias(view as SingleEntityView);
                    break;

                case ViewType.Join:
                    VisitViewAlias(view as JoinView);
                    break;
            }
        }
Пример #7
0
 public IReadOnlyList<SingleEntityView> VisitAlias(View view)
 {
     _list = new List<SingleEntityView>();
     VisitViewAlias(view);
     return _list;
 }
Пример #8
0
 public virtual StringBuilder BuildSelectColumns(View view)
 {
     Visit(view);
     return _str.RemoveEnd(_tr.ColumnDelimiter);
 }
Пример #9
0
 public Query(View view, Criteria criteria)
 {
     _view = view;
     //Note:criteria can be null, view.OrderBy(..) or view.AsQuery()
     _criteria = criteria;
 }