PutPipelineAsync conversion from vb.net to c#

I am trying to convert some 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.

        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:

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

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

From Elastic Search to Elasticsearch

Added language-clients

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