18 using System.Collections.Generic;
19 using System.Collections.ObjectModel;
24 namespace Deveel.Data.Sql {
33 ParameterStyle = parameterStyle;
44 if (parameters != null) {
45 foreach (var parameter
in parameters) {
46 Parameters.Add(parameter);
51 public string Text {
get;
private set; }
53 public ICollection<QueryParameter> Parameters {
get;
private set; }
59 data.
SetValue(
"ParameterStyle", (
int)ParameterStyle);
61 var parameters = Parameters.ToArray();
62 if (parameters.Length > 0)
63 data.
SetValue(
"Parameters", parameters);
68 throw new InvalidOperationException();
70 throw new ArgumentException();
72 ParameterStyle = style;
75 #region QueryParameterCollection
86 throw new ArgumentNullException(
"item");
90 throw new ArgumentException(String.Format(
"The query accepts markers, but the parameter '{0}' is named.", item.
Name));
93 throw new ArgumentException(
"The query accepts named parameters, but a marker was set.");
95 if (Items.Any(x => String.Equals(x.Name, item.
Name)))
96 throw new ArgumentException(String.Format(
"A parameter named {0} was already inserted in the query.", item.
Name));
101 ValidateParameter(item);
102 base.InsertItem(index, item);
106 ValidateParameter(item);
107 base.SetItem(index, item);
void GetData(SerializeData data)
override void InsertItem(int index, QueryParameter item)
QueryParameterStyle ParameterStyle
void SetValue(string key, Type type, object value)
void ValidateParameter(QueryParameter item)
No specific form of the parameter was given: this default to the system default parameter style confi...
void ChangeStyle(QueryParameterStyle style)
SqlQuery(string text, QueryParameterStyle parameterStyle)
override void SetItem(int index, QueryParameter item)
QueryParameterStyle
In a SQL query object, this is the form of parameters passed from the client side to the server side...
object GetValue(string key)
SqlQuery(ObjectData data)
string GetString(string key)
QueryParameterCollection(SqlQuery sqlQuery)