# Creating a DTO

Let's see this with an example. In this case we will create a mapper for a Button model.

First we need a DTO. A DTO is Plain Old C# Object (POCO). In this example our DTO will be like the following:

A DTO class **must** use a `DataTransfer` attribute from `Mobilize.WebMap.Common.Attributes`.

```
    [DataTransfer("btn")]
    public class Button
    {
        public string Text { get; set; }
        public string Name { get; set; }
    }
```

Or alternatively must implement the **IDataTransfer** interface.

```
public class Button : IDataTransfer
{
public string Text { get; set; }
public string Id { get; set; }
public string MapperId { get; set; }
}
```

Follow these guidelines when creating your DTOs:

* classes should not inherit from any other classes
* use nullable types for value types. For example `int?` instead of `int`
* the name used on the `DataTransfer` attribute should be
  * unique
  * as short as possible
  * it should start with a lowercase consonant
  * it should not use vowels
  * if it is made up of several words the next word should have just its first letter in uppercase


---

# 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://docs.gapvelocity.ai/webmap/general/backend/dcp-desktop-compatibly-platform/library-bundles/bundle-dto/dto-data-transfer-objects/untitled.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.
