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); }
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(); } }
public FirstOrDefaultQueryCommand(IQueryCommandOptions options, IObjectMapping mapping) : base(options, mapping, true) { }
public SingleQueryCommand(IQueryCommandOptions options, IObjectMapping mapping) : base(options, mapping, true) { }
public GetRequestCommand(IQueryCommandOptions options, IObjectMapping mapping) : base(options, mapping, true) { }
public AnyQueryCommand(IQueryCommandOptions options, IObjectMapping mapping) : base(options, mapping, false) { }
public MockStandardQueryCommand(IQueryCommandOptions options, IObjectMapping mapping) : base(options, mapping) { }