Question: ```
import json 

with open("madagascar.geojson") as f:
    data = json.load(f)

```

I am completely lost as to where to go with this. This is all the code I have produced, as I am new to python. I have a Madagascar geojson file I am trying to read using json. Once I have done that I would like to print out the 5th region in the data set using a phrase to the effect of "“The fifth record is for X, whose area is Y sq km." with X being region name and Y being the area.

How would I go about doing this? 

GeoJSON text file: <https://drive.google.com/file/d/1we40zpuGQICfyTw7YtJ39OY7gtPUQJr7/view?usp=sharing>

Answer: 
As mentioned in the comments, it is not clear what you trying to achieve, but in order to do DI in .Net Core you have to create an interface IMyClass, then let your class implement that interface,

```
public interface IMyClass {
   void SampleMethod();
}

public class MyClass : IMyClass
{
    ILoginTokenKeyApi _loginTokenKeyApi;

    public MyClass(ILoginTokenKeyApi loginTokenKeyApi)
    {
        _loginTokenKeyApi = loginTokenKeyApi;
    }

    public void SampleMethod()
    {
        // method logic goes here...
        var xx = _loginTokenKeyApi.WhatEver;
    }
}

```

then register ILoginTokenProvider and IMyClass in startup.cs

```
services.AddTransient<ILoginTokenProvider, LoginTokenProvider>();
services.AddTransient<IMyClass, MyClass>();

```

finally inject IMyClass where you need it:

```
public class IndexModel : PageModel {

    private readonly IMyClass _myClass;

    public IndexModel(IMyClass myClass)
    {
        _myClass = myClass;
    }

    public void OnGet()
    {
       _myClass.SampleMethod();
    }
}

```

btw, it is also possible to register and inject MyClass without implementing IMyClass interface, but I prefer to follow basic programming principals :)
There are two types of Dependency Injections.

1. Constructor Injection - which you dont want
2. Property Injection - In this - you expose Public Get/Set property of the Object you want to be injected. And then in your DI config file (like spring.net) you can assign values.

Another way you can do DepInjection is that in the param less constructor - you can get the Object by a Key/Name. Like in Spring.Net we would do:

```
var UtilityObject = Spring.ContextRegistry.GetContext().GetObject("MyUtilObject") as TheUtilityClass;

```