public FSSubQuery(FSUtil util)
        {
            _util = util;

            Relations  = new FSSubQueryList <TFSSubEntity, TFSEntity>(_util);
            Conditions = new FSQueryList <TFSSubEntity>(_util);
        }
 public string Exists <TFSSubEntity>(
     Expression <Func <TFSSubEntity, object> > from     = null,
     FSSubQueryList <TFSSubEntity, TFSEntity> relations = null,
     FSQueryList <TFSSubEntity> conditions = null
     ) where TFSSubEntity : class, IDevFrameworkDataObject
 {
     return(SubQuery(" EXISTS ", () => new FSSubQuery <TFSEntity, TFSSubEntity>(
                         FSUtil,
                         from: from,
                         relations: relations,
                         conditions: conditions
                         ).ToString()));
 }
 public string Like <TFSSubEntity>(Expression <Func <TFSEntity, object> > prop, Expression <Func <TFSSubEntity, object> > field = null,
                                   Expression <Func <TFSSubEntity, object> > from = null,
                                   string alias = null,
                                   FSSubQueryList <TFSSubEntity, TFSEntity> relations = null,
                                   FSQueryList <TFSSubEntity> conditions = null)
     where TFSSubEntity : class, IDevFrameworkDataObject
 {
     return(SubQuery($" {Entity.Prop(prop)} LIKE ", () => new FSSubQuery <TFSEntity, TFSSubEntity>(
                         FSUtil,
                         field: field,
                         fieldModifier: x => $"{x} + '%'",
                         from: from,
                         alias: alias,
                         relations: relations,
                         conditions: conditions
                         ).ToString()));
 }
 public string In <TFSSubEntity>(
     Expression <Func <TFSEntity, object> > prop,
     Expression <Func <TFSSubEntity, object> > field = null,
     Expression <Func <TFSSubEntity, object> > from  = null,
     string alias = null,
     FSSubQueryList <TFSSubEntity, TFSEntity> relations = null,
     FSQueryList <TFSSubEntity> conditions = null
     ) where TFSSubEntity : class, IDevFrameworkDataObject
 {
     return(SubQuery($" {Entity.Prop(prop)} IN ", () => new FSSubQuery <TFSEntity, TFSSubEntity>(
                         FSUtil,
                         field,
                         from,
                         alias,
                         relations,
                         conditions
                         ).ToString()));
 }
        public FSSubQuery(
            FSUtil util,
            Expression <Func <TFSSubEntity, object> > field = null,
            Expression <Func <TFSSubEntity, object> > from  = null,
            string alias = null,
            FSSubQueryList <TFSSubEntity, TFSEntity> relations = null,
            FSQueryList <TFSSubEntity> conditions = null,
            Func <string, string> fieldModifier   = null
            ) : this(util)
        {
            _util = util;

            if (field != null)
            {
                FieldExpr = field;
            }

            if (fieldModifier != null)
            {
                FieldModifier = fieldModifier;
            }

            if (from != null)
            {
                FromExpr = from;
            }

            if (alias != null)
            {
                Alias = alias;
            }

            if (relations != null)
            {
                Relations = relations;
            }

            if (conditions != null)
            {
                Conditions = conditions;
            }
        }