Exemplo n.º 1
0
 public string GetSQL(string name)
 {
     if (SqlCache.TryGetValue(name, out var value))
     {
         return(value[0]);
     }
     throw new KeyNotFoundException($"SQL element with name {name} is not found.");
 }
Exemplo n.º 2
0
 public (string CountSQL, string QuerySQL) GetPagingSQL(string name)
 {
     if (!SqlCache.TryGetValue(name, out var value))
     {
         throw new KeyNotFoundException($"SQL element with name {name} is not found.");
     }
     if (value.Length != 2)
     {
         throw new ArgumentException("Wrong paging SQL configuration.");
     }
     return(value[0], value[1]);
 }