# AutoMapper extensions

[Automapper](https://github.com/AutoMapper/AutoMapper)-related extensions for working with different types of collections.

## Installation

Collections package is available on [NuGet](https://www.nuget.org/packages/Structr.Collections.Extensions.Automapper/).

```
dotnet add package Structr.Collections.Extensions.Automapper
```

## Usage

Provided extensions allow to perform one-string mappings between collections without a redundant code.

```csharp
var list = new List<Foo>
{
     new Foo { Id = 1, Name = "Bar"},
     new Foo { Id = 2, Name = "Baz"}
};
var mappedCollection = mapper.MapList<FooDto>(list);
```


---

# 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.structr.dev/utilities/collections/automapper-extensions.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.
