public IQueryCommand GetCommand(QueryCommandType type, IQueryCommandOptions options, IObjectMapping mapping)
        {
            switch (type)
            {
            case QueryCommandType.StandardCommand:
                return(new StandardQueryCommand(options, mapping));

            case QueryCommandType.AnyCommand:
                return(new AnyQueryCommand(options, mapping));

            case QueryCommandType.CountCommand:
                return(new CountQueryCommand(options, mapping));

            case QueryCommandType.FirstOrDefaultCommand:
                return(new FirstOrDefaultQueryCommand(options, mapping));

            case QueryCommandType.SingleCommand:
                return(new SingleQueryCommand(options, mapping));

            case QueryCommandType.SingleOrDefaultCommand:
                return(new SingleOrDefaultQueryCommand(options, mapping));

            case QueryCommandType.GetRequestCommand:
                return(new GetRequestCommand(options, mapping));

            default:
                throw new NotSupportedException(string.Format("QueryCommandType '{0}' is not supported.", type));
            }
        }
        public IQueryCommand GetCommand(QueryCommandType type, IQueryCommandOptions options, IObjectMapping mapping)
        {
            Type    = type;
            Options = options;
            Mapping = mapping;

            return(QueryCommandToReturn);
        }
示例#3
0
 protected QueryCommand(IQueryCommandOptions options, IObjectMapping mapping, bool initializeAttributes)
 {
     Options       = options;
     Mapping       = mapping;
     SearchRequest = new SearchRequest {
         Filter = options.Filter
     };
     if (Options.Controls != null)
     {
         SearchRequest.Controls.AddRange(Options.Controls.ToArray());
     }
     if (initializeAttributes)
     {
         InitializeAttributes();
     }
 }
示例#4
0
 public FirstOrDefaultQueryCommand(IQueryCommandOptions options, IObjectMapping mapping)
     : base(options, mapping, true)
 {
 }
示例#5
0
 public SingleQueryCommand(IQueryCommandOptions options, IObjectMapping mapping)
     : base(options, mapping, true)
 {
 }
示例#6
0
 public GetRequestCommand(IQueryCommandOptions options, IObjectMapping mapping) : base(options, mapping, true)
 {
 }
示例#7
0
 public AnyQueryCommand(IQueryCommandOptions options, IObjectMapping mapping)
     : base(options, mapping, false)
 {
 }
示例#8
0
 public MockStandardQueryCommand(IQueryCommandOptions options, IObjectMapping mapping) : base(options, mapping)
 {
 }