/// <summary>
/// Verifies if a query is valid even if it has not spaces or is a stored procedure call
/// </summary>
/// <param name="query">Query to validate</param>
/// <returns>If it is necessary to add call statement</returns>
private bool AddCallStatement(string query)
{
if (string.IsNullOrEmpty(query))
{
return(false);
}
string keyword = query.ToUpper();
int indexChar = keyword.IndexOfAny(new char[] { '(', '"', '@', '\'', '`' });
if (indexChar > 0)
{
keyword = keyword.Substring(0, indexChar);
}
if (keywords == null)
{
keywords = SchemaProvider.GetReservedWords().AsDataTable().
Select().
Select(x => x[0].ToString()).ToList();
}
return(!keywords.Contains(keyword));
}