Frequently Asked Questions

Direct, factual answers to common questions about AutoMapperLite.

What is AutoMapperLite?
AutoMapperLite is a lightweight object-to-object mapper for .NET. It maps properties between source and destination types (typically entities and DTOs) using fluent CreateMap/ForMember/ForPath profiles, compiling each mapping into a cached delegate rather than interpreting it via reflection on every call.
What is AutoMapperLite used for?
Mapping between layers of an application — for example, converting database entities into API DTOs/view models and back — without hand-writing repetitive property-assignment code.
Is AutoMapperLite free?
Yes, completely free for personal and commercial use.
Is AutoMapperLite open source?
Yes. The source code is public on GitHub under the MIT License.
What license does AutoMapperLite use?
The MIT License — permissive, free, no commercial-use restrictions.
Which .NET versions does AutoMapperLite support?
net6.0, net7.0, net8.0, net9.0, and net10.0.
How do I install AutoMapperLite?
dotnet add package AutoMapperLite --version 4.4.1. See Getting Started for the full walkthrough.
How do I map an object with AutoMapperLite?
Register a map with config.CreateMap<TSource, TDestination>() inside a Profile, then call mapper.Map<TDestination>(source). See Examples → Basic mapping.
How does AutoMapperLite compare with AutoMapper?
Both compile mappings into cached expression-tree delegates rather than using reflection at runtime. AutoMapperLite is smaller in scope — no LINQ ProjectTo, no large convention/coercion engine — in exchange for a minimal dependency footprint and no commercial licensing considerations. See the full comparison.
How does AutoMapperLite compare with Mapster?
Mapster uses compiled expressions/source generators for maximum throughput and has a broader feature set; AutoMapperLite favors simplicity and a small footprint over raw peak performance. See the comparison and performance pages.
Is AutoMapperLite lightweight?
Yes — a single small library with one runtime dependency (Microsoft.Extensions.DependencyInjection.Abstractions), no code generation step, no large convention engine.
How does AutoMapperLite handle nested objects?
Same-named nested properties with a registered map are mapped automatically and recursively. For differently-named or differently-shaped nested properties, use ForMember or ForPath with a mapping function that calls back into the mapper — see Examples → Nested object mapping.
Does AutoMapperLite support collections?
Yes — List<T>, arrays, and common collection interfaces (IList<T>, ICollection<T>, IReadOnlyList<T>, IReadOnlyCollection<T>, IEnumerable<T>) are all supported as mapping destinations, both at the top level and as nested properties, as long as a map is registered for the item types. See Examples → Collections.
Does AutoMapperLite support dependency injection?
Yes — AddAutoMapperLite(Assembly) registers IMapperConfig and IMapper as singletons in Microsoft.Extensions.DependencyInjection.
Is AutoMapperLite thread-safe?
Yes. Configuration and mapping are both safe for concurrent use, verified by dedicated concurrency tests in the repository.
Does AutoMapperLite support enum, numeric, or type conversion?
Only exact type matches auto-map, or types with a registered CreateMap. Two different enum types (even with identical member names), enum → string, and numeric widening (int → long) are not converted automatically — the destination property is silently left at its default. Use ForMember for explicit conversions. See Guide → Limitations.
Does AutoMapperLite support records or constructor mapping?
Records with a parameterless constructor and { get; init; } properties work fine. Positional records (record Foo(int A)) and any type without a public parameterless constructor are not supported as mapping destinations — instances are created via a compiled constructor call (Expression.New), not Activator.CreateInstance, with a clear error naming the type when that fails. See Guide → Limitations.