using System.Collections.Generic;
private static string getUrl = "https://raw.githubusercontent.com/tester1-1/testdata/main/data.json";
public static void Main()
var client = new RestClient(getUrl);
var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);
if (response.StatusCode == System.Net.HttpStatusCode.OK)
string result = response.Content;
var classResult= JsonConvert.DeserializeObject<IDictionary<string, Subjects>>(result);
var highestMarks = classResult.Max(r=> r.Value.Math1);
var lowestMarks = classResult.Min(r=> r.Value.Math1);
Console.WriteLine("Highest Marks in Math1 subject :"+highestMarks);
Console.WriteLine("Lowest Marks in Math1 subject :"+lowestMarks);
throw new Exception(string.Format("Not able to consume the API: {0}", response.ErrorException));