0

I have the following code:

        public List<GitHub.Plugin> GetPluginStoreNames() => GitHub.GetJsonNames();


        public class GitHub
        {
        
            public class Plugins
            {
                public List<Plugin> plugins { get; set; }
            }

            public class Plugin
            {
                public string name { get; set; }
                public string desc { get; set; }
                public string author { get; set; }
                public string download { get; set; }
            }


            public List<Plugin> GetJsonNames()
            {
                using HttpClient client = new();
                client.BaseAddress = new Uri("https://raw.githubusercontent.com/BlazeBullet/store/master/");
                client.DefaultRequestHeaders.UserAgent.ParseAdd("Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0");
                var myJsonResponses = client.GetAsync("Plugins.json").Result.ToString();
                Plugins plugins = JsonConvert.DeserializeObject<Plugins>(myJsonResponses);


                return plugins;
            }
        };

I get the following error: Severity Code Description Project File Line Suppression State Error CS0120 An object reference is required for the non-static field, method, or property 'GitHub.GetJsonNames()' RuriLib C:\Users\Shadow\source\repos\BlazeBullet\RuriLib\Services\PluginRepository.cs 71 Active

How can I create a List from the JSON response

0 Answers0