# PutPipelineAsync conversion from vb.net to c#

**URL:** https://discuss.elastic.co/t/putpipelineasync-conversion-from-vb-net-to-c/365411
**Category:** Elasticsearch
**Tags:** language-clients
**Created:** [August 22, 2024, 9:22pm UTC](https://discuss.elastic.co/t/putpipelineasync-conversion-from-vb-net-to-c/365411 "2024-08-22T21:22:05Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![kvickery](https://avatars.discourse-cdn.com/v4/letter/k/8c91f0/32.png) [@kvickery](https://discuss.elastic.co/u/kvickery)
#### Post date: [August 22, 2024, 9:22pm UTC](https://discuss.elastic.co/t/putpipelineasync-conversion-from-vb-net-to-c/365411/1 "2024-08-22T21:22:05Z")

</div>

I am trying to convert some [vb.net](http://vb.net) code for some old Elasticsearch over to C# with Elasticsearch 8. Simply converting to C# gives me the code below, but I am getting "cannot convert lambda expression to type field (or fields) because it is not a delegate type.

Can someone point me in the right direction? To be honest I don't have a great grasp on working with these Elasticsearch definitions.

```auto
        var putPipelineResponse = await client.Ingest.PutPipelineAsync(
            pipelineName,
            p => p.Description("Document Attachment Pipeline")
            .Processors(pr => pr.Attachment<IndexedDocument>(a => a.Field(f => f.FileContent).TargetField(f => f.Attachment)).Remove<IndexedDocument>(r => r.Field(f => f.Field<string>(ff => ff.FileContent)))));

```

My IndexedDocument class, simplified, is:

```auto
internal class IndexedDocument
{
    public int Id { get; set; }

    public Attachment Attachment { get; set; }
    public string FileContent { get; set; }
}

```

---

<div class="post-metadata">

### Author: ![Carlos\_D](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/carlos_d/32/126245_2.png) [@Carlos\_D](https://discuss.elastic.co/u/Carlos_D)
#### Post date: [September 3, 2024, 7:43am UTC](https://discuss.elastic.co/t/putpipelineasync-conversion-from-vb-net-to-c/365411/2 "2024-09-03T07:43:52Z")

</div>

From #Elastic Search to #Elasticsearch

---

<div class="post-metadata">

### Author: ![Carlos\_D](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/carlos_d/32/126245_2.png) [@Carlos\_D](https://discuss.elastic.co/u/Carlos_D)
#### Post date: [September 3, 2024, 7:43am UTC](https://discuss.elastic.co/t/putpipelineasync-conversion-from-vb-net-to-c/365411/3 "2024-09-03T07:43:52Z")

</div>

Added #language-clients

---

<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: [October 1, 2024, 7:44am UTC](https://discuss.elastic.co/t/putpipelineasync-conversion-from-vb-net-to-c/365411/4 "2024-10-01T07:44:14Z")

</div>

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