I've made a service on C # and now I need to connect this service to my bank on FireBase . The following is the Library method for connecting to FireBase :
public static void restAPI()
{
var client = new RestClient("https://teste.firebaseio.com/");
var request = new RestRequest("users.json", Method.GET);
var queryResult = client.Execute<List<Items>>(request).Data;
Library.WriteErrorLog("RESTAPI: " + queryResult);
}
Function in Shceduler to initialize the service and call the method:
protected override void OnStart(string[] args)
{
Library.restAPI();
if (Library.IsConnected())
{
Library.WriteErrorLog("////// Com conexão! //////");
timer1 = new Timer();
this.timer1.Interval = 3000;
this.timer1.Elapsed += new System.Timers.ElapsedEventHandler(this.timer1_Tick);
Library.WriteErrorLog(">> Test Window Service iniciado! <<");
if (!File.Exists(docBase))
{
File.Copy(pricetabLocal, docBase);
listaBase = Library.MontarListaBase(docBase, ref copiado);
Library.WriteErrorLog("<< FIM! >>" + copiado);
}
else
{
Library.WriteErrorLog("Ja existe um arquivo com este nome!");
listaBase = Library.MontarListaBase(docBase, ref copiado);
Library.WriteErrorLog("<< FIM! >>" + copiado);
}
timer1.Enabled = true;
}
else
{
Library.WriteErrorLog("////// Sem conexão! //////");
}
}
Public Class Items:
public class Items
{
public string usuarios { get; set; }
}
ACHO I was able to make the connection but I can not see the correct content, the answer that returns is as follows:
RESTAPI: System.Collections.Generic.List'1 [TestWindowsService.Library + Items]
ps: This answer I write in a notebook.
This answer means what? If I connected, how do I "pan" this response to format it?