https://github.com/TinyMapper/TinyMapper
A quick object-object mapper for .NET
https://github.com/TinyMapper/TinyMapper
Last synced: 3 months ago
JSON representation
A quick object-object mapper for .NET
- Host: GitHub
- URL: https://github.com/TinyMapper/TinyMapper
- Owner: TinyMapper
- License: mit
- Created: 2015-01-05T13:48:38.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2024-05-27T08:19:15.000Z (9 months ago)
- Last Synced: 2024-11-07T17:58:31.355Z (4 months ago)
- Language: C#
- Homepage: http://tinymapper.net
- Size: 3.94 MB
- Stars: 691
- Watchers: 49
- Forks: 112
- Open Issues: 40
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.markdown
- License: LICENSE
Awesome Lists containing this project
- my-awesome - TinyMapper - A quick object-object mapper for .NET (C#)
README
TinyMapper - a quick object mapper for .Net
======================================================
[](https://www.nuget.org/packages/TinyMapper/)
[](https://github.com/TinyMapper/TinyMapper/blob/master/LICENSE)
[](http://www.firsttimersonly.com/)## Performance Comparison

## Installation
Available on [nuget](https://www.nuget.org/packages/TinyMapper/)
PM> Install-Package TinyMapper
## Getting Started
```csharp
TinyMapper.Bind();var person = new Person
{
Id = Guid.NewGuid(),
FirstName = "John",
LastName = "Doe"
};var personDto = TinyMapper.Map(person);
```Ignore mapping source members and bind members with different names/types
```csharp
TinyMapper.Bind(config =>
{
config.Ignore(x => x.Id);
config.Ignore(x => x.Email);
config.Bind(source => source.LastName, target => target.Surname);
config.Bind(target => source.Emails, typeof(List));
});var person = new Person
{
Id = Guid.NewGuid(),
FirstName = "John",
LastName = "Doe",
Emails = new List{"[email protected]", "[email protected]"}
};var personDto = TinyMapper.Map(person);
````TinyMapper` supports the following platforms:
* .Net 3.5+
* [.NET Standard 1.3](https://docs.microsoft.com/en-us/dotnet/standard/net-standard)
* .NET Core
* Mono## What to read
* [TinyMapper: yet another object to object mapper for .net](http://www.codeproject.com/Articles/886420/TinyMapper-yet-another-object-to-object-mapper-for)
* [Complex mapping](https://github.com/TinyMapper/TinyMapper/wiki/Complex-mapping)
* [How to create custom mapping](https://github.com/TinyMapper/TinyMapper/wiki/Custom-mapping)
## Contributors
A big thanks to all of TinyMapper's contributors:
* [nzaugg](https://github.com/nzaugg)
* [Sdzeng](https://github.com/Sdzeng)
* [iEmiya](https://github.com/iEmiya)
* [lijaso](https://github.com/lijaso)
* [nomailme](https://github.com/nomailme)
* [Skaiol](https://github.com/Skaiol)
* [Sufflavus](https://github.com/Sufflavus)
* [qihangnet](https://github.com/qihangnet)
* [teknogecko](https://github.com/teknogecko)
* [Samtrion](https://github.com/Samtrion)
* [DerHulk](https://github.com/DerHulk)