Esempio n. 1
0
        protected SqlSelectInfo Join <TJoin>(JoinType joinType, ISqlFilter condition, SqlAlias <TJoin> joinAlias = null)
        {
            if (condition == null)
            {
                throw new ArgumentNullException(nameof(condition));
            }
            if (joinAlias == null)
            {
                joinAlias = MetadataProvider.AliasFor <TJoin>();
            }
            if (Info.Joins().Any(j => j.JoinAlias.Value == joinAlias.Value))
            {
                throw new JoinException($"Alias '{joinAlias.Value}' is already registered");
            }

            var join = new SqlJoin <TJoin>(joinType, condition, joinAlias);

            return(Info.Joins(join));
        }