public IEnumerable<TaskModel> GetTasks()
{
var request = CreateWebApiRequest(SchedulerConstants.TaskRelativePath);
request.Method = "GET";
try
{
var response = (HttpWebResponse) request.GetResponse();
string jsonResponse;
using (var sr = new StreamReader(response.GetResponseStream()))
{
jsonResponse = sr.ReadToEnd();
}
return JsonConvert.DeserializeObject<List<TaskModel>>(jsonResponse);
}
catch (WebException we)
{
throw CreateSchedulerException(we);
}
}