Question: I am learning ElasticSearch following the example [elasticsearch-net-example](https://github.com/elastic/elasticsearch-net-example/tree/6.x-netcore).
The error occurs in the following code:

```
        foreach (var package in packages)
        {
            var result = Client.Index(package); <--The type arguments for method 'ElasticClient.Index<T>(IIndexRequest<T>)' cannot be inferred from the usage. Try specifying the type arguments explicitly.

            if (!result.IsValid)
            {
                Console.WriteLine(result.DebugInformation);
                Console.Read();
                Environment.Exit(1);
            }
        }

```

I tried to specify the type of the argument as follows:

```
var result = Client.Index<FeedPackage>(package);

```

but this leads to another error:

Argument 1: cannot convert from 'NuSearch.Domain.Model.FeedPackage' to 'Nest.IIndexRequest' NuSearch.Indexer

Can you please tell me what am I doing wrong? Perhaps the question is too simple, but I had difficulties with it.

Answer: 
I just met the same problem. Changing the code to `var result = Client.Index<FeedPackage>(package, i => i.Type("package"));` as MiXaiL suggested in his upvoted answer does not work because it won't compile. However, simply changing `Index()` to `IndexDocument()` works beautifully:

```
var result = Client.IndexDocument(package);

```
I've had the same issue just a minute ago. Make sure you are using proper .net client version. In my case I was looking at doc for version 1.x while using version 7.x of the client - may bad :)

Current version is available here: <https://www.elastic.co/guide/en/elasticsearch/client/net-api/current/nest-getting-started.html>