# Ejemplo: Agregar un Cliente

En este ejemplo utilizaremos [WriteOperation](broken://pages/mtbmARaodfwn8MLV70wu) de [Dinaup SDK (.NET)](/desarrollo/sdk.md) para agregado un cliente en la Sección [Entidades](broken://pages/bPlGy6jVP8RxvwIsL7YO), con la opción de Cliente (bool) activada.

```csharp
 
public async Task<Guid> AddCustomer()
{
 
    var datosCliente = new Dictionary<string, string>
    {
        { SectionsD.EntidadesD.EntidadesES.TextoPrincipal, $"Cliente {Guid.NewGuid()}" },
        { SectionsD.EntidadesD.EntidadesES.NombrePersonalRazonSocial, "Juan García S.A." },
        { SectionsD.EntidadesD.EntidadesES.Apellidos, "García López" },
        { SectionsD.EntidadesD.EntidadesES.Cliente, "1" }
    };

    var writeOperation = new WriteOperation(string.Empty, datosCliente);
    var seccionID = SectionsD.EntidadesD._SectionIDGUID;

    try
    {
  
        var resultado = await Client.RunWriteOperationAsync(Client.DefaultSession, seccionID, writeOperation, false);
        resultado.EnsureSuccess();
        return writeOperation.WriteOperationResult.RowID;
    }
    catch (Exception ex)
    { 
        Dinaup.Logs.Error(ex, "AddCustomer");
    }
}

```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://doc.dinaup.com/desarrollo/sdk/cliente/ejemplo-agregar-cliente.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
