# How to create a document using the .NET library?

**URL:** <https://discuss.elastic.co/t/how-to-create-a-document-using-the-net-library/267584>\
**Category:** Elasticsearch\
**Tags:** language-clients\
**Created:** [March 17, 2021, 11:20pm UTC](https://discuss.elastic.co/t/how-to-create-a-document-using-the-net-library/267584 "2021-03-17T23:20:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jay2021](https://avatars.discourse-cdn.com/v4/letter/j/7feea3/32.png) [@jay2021](https://discuss.elastic.co/u/jay2021)\
**Post date:** [March 17, 2021, 11:20pm UTC](https://discuss.elastic.co/t/how-to-create-a-document-using-the-net-library/267584/1 "2021-03-17T23:20:33Z")

</div>

Hello, I am trying to create a document using the .NET library.

Here is the code that I attempted

```auto
           var newLogResponse = await elasticClient.CreateAsync(new ElasticJobLog()
            {
                CreatedAt = endSearchTime,
                JobName = _jobName,
                Source = _source,
                Success = true,
            }, p=> p.Index("name_of_my_index"));

```

But, the above code throws the following error

```auto
Error Message: No route taking 1 parameters{index}/_create/{id} 

```

Here is the stack trace

```auto
Stack Trace: at Nest.ApiUrls.Resolve(RouteValues routeValues, IConnectionSettingsValues settings)
   at Nest.RequestBase`1.ResolveUrl(RouteValues routeValues, IConnectionSettingsValues settings)
   at Nest.RequestBase`1.Nest.IRequest.GetUrl(IConnectionSettingsValues settings)
   at Nest.ElasticClient.DoRequestAsync[TRequest,TResponse](TRequest p, IRequestParameters parameters, CancellationToken ct, Action`1 forceConfiguration)
   at Nest.ElasticClient.CreateAsync[TDocument](ICreateRequest`1 request, CancellationToken ct)
   at Nest.ElasticClient.CreateAsync[TDocument](TDocument document, Func`2 selector, CancellationToken ct)

```

How can I fix this issue?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [April 14, 2021, 11:21pm UTC](https://discuss.elastic.co/t/how-to-create-a-document-using-the-net-library/267584/2 "2021-04-14T23:21:16Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
