1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- using Newtonsoft.Json;
- namespace InABox.DatabaseProxy
- {
- public class Credentials
- {
- private static readonly string cacheToken = Guid.NewGuid().ToString().Replace("-", "");
- public string CacheToken => cacheToken;
- public string UserID { get; set; }
- public string Password { get; set; }
- }
- public class Request
- {
- public Request()
- {
- Credentials = new Credentials();
- }
- public Credentials Credentials { get; set; }
- public string Database { get; set; }
- public string SQL { get; set; }
- public string AsJSON()
- {
- return JsonConvert.SerializeObject(this);
- }
- ~Request()
- {
- Credentials = null;
- }
- public override string ToString()
- {
- return SQL;
- }
- }
- public class Response
- {
- public Response()
- {
- Status = "INCOMPLETE";
- Data = new List<List<object>>();
- }
- public string Status { get; set; }
- public List<List<object>> Data { get; private set; }
- ~Response()
- {
- Data = null;
- }
- }
- }
|