{"id":27268747,"url":"https://github.com/dogusteknoloji/batmap","last_synced_at":"2025-04-11T11:32:16.227Z","repository":{"id":65414014,"uuid":"87973014","full_name":"DogusTeknoloji/BatMap","owner":"DogusTeknoloji","description":"🦇 Convention-based, fast object mapper.","archived":false,"fork":false,"pushed_at":"2023-02-06T13:42:53.000Z","size":194,"stargazers_count":220,"open_issues_count":2,"forks_count":26,"subscribers_count":30,"default_branch":"master","last_synced_at":"2025-04-08T09:49:30.786Z","etag":null,"topics":["dto","entity","mapper","mapping","projector"],"latest_commit_sha":null,"homepage":"https://dogusteknoloji.github.io/BatMap/","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DogusTeknoloji.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-04-11T19:46:10.000Z","updated_at":"2025-02-14T11:32:41.000Z","dependencies_parsed_at":"2023-02-19T08:16:11.790Z","dependency_job_id":null,"html_url":"https://github.com/DogusTeknoloji/BatMap","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DogusTeknoloji%2FBatMap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DogusTeknoloji%2FBatMap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DogusTeknoloji%2FBatMap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DogusTeknoloji%2FBatMap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DogusTeknoloji","download_url":"https://codeload.github.com/DogusTeknoloji/BatMap/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248384063,"owners_count":21094668,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dto","entity","mapper","mapping","projector"],"created_at":"2025-04-11T11:31:53.875Z","updated_at":"2025-04-11T11:32:16.219Z","avatar_url":"https://github.com/DogusTeknoloji.png","language":"C#","readme":"# BatMap - The Mapper we deserve, not the one we need.\n\u003cimg src=\"https://image.ibb.co/jDUyWQ/logo_64x64.png\" alt=\"🦇 BatMap\" align=\"middle\"\u003e **Opininated (yet another) mapper, mainly to convert between EF Entities and DTOs.** \n\nSupports .Net Standard 1.0.\n\n[![Build status](https://ci.appveyor.com/api/projects/status/m6gh59s077a52xen?svg=true)](https://ci.appveyor.com/project/DogusTeknoloji/batmap)\n[![Coverage Status](https://coveralls.io/repos/github/DogusTeknoloji/BatMap/badge.svg?branch=master)](https://coveralls.io/github/DogusTeknoloji/BatMap?branch=master)\n[![NuGet Badge](https://buildstats.info/nuget/BatMap)](https://www.nuget.org/packages/BatMap/)\n[![Join the chat at https://gitter.im/NaNaNaNaBatMap/Lobby](https://badges.gitter.im/NaNaNaNaBatMap/Lobby.svg)](https://gitter.im/NaNaNaNaBatMap/Lobby?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n[![GitHub issues](https://img.shields.io/github/issues/DogusTeknoloji/BatMap.svg)](https://github.com/DogusTeknoloji/BatMap/issues)\n[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/DogusTeknoloji/BatMap/master/LICENSE)\n\n[![GitHub stars](https://img.shields.io/github/stars/DogusTeknoloji/BatMap.svg?style=social\u0026label=Star)](https://github.com/DogusTeknoloji/BatMap)\n[![GitHub forks](https://img.shields.io/github/forks/DogusTeknoloji/BatMap.svg?style=social\u0026label=Fork)](https://github.com/DogusTeknoloji/BatMap)\n\nLet's first obey the number one rule for mappers, a benchmark (using [BenchmarkDotNet](http://benchmarkdotnet.org/)):\n\n|        Method |     Mean |\n|-------------- |---------:|\n|   HandWritten | 1.143 ms |\n|        BatMap :boom: | 2.000 ms |\n|    SafeMapper | 2.933 ms |\n|       Mapster | 2.942 ms |\n|    AutoMapper | 3.497 ms |\n|    TinyMapper | 4.172 ms |\n| ExpressMapper | 6.955 ms |\n|    FastMapper | 9.203 ms |\n\n\u003csup\u003eResults may (probably) vary. Latest run can bee seen on [Appveyor Build](https://ci.appveyor.com/project/DogusTeknoloji/batmap).\u003c/sup\u003e\n    \n* Fast (enough)\n* NOT over-engineered, code is really simple\n* Instantiatable mapper\n* Convention based, zero configuration static shortcut exists too (obviously named Mapper)\n* Does not crash when faced with circular-dependencies during registration\n* In fact, can resolve recurring instances to same target instance (yaay no StackOverflowException!)\n* Can project IQueryable\\\u003cTSource\\\u003e to IQueryable\\\u003cTTarget\\\u003e with respect to includes (via auto-detection or with custom parameters)\n* and much more...\n\n## API\nRegistration with static API:\n```csharp\nMapper.RegisterMap\u003cCustomer, CustomerDTO\u003e();\n```\nor use an instance:\n```csharp\nvar mapper = new MapConfiguration(dynamicMapping: DynamicMapping.MapAndCache, preserveReferences: true);\nmapper.RegisterMap\u003cCustomer, CustomerDTO\u003e();\n```\nNote: You don't have to register type mappings when using a MapConfiguration with Dynamic Mapping enabled (like the static API uses).\n\n\nYou can customize expressions for members:\n```csharp\nmapper.RegisterMap\u003cOrder, OrderDTO\u003e(b =\u003e b.MapMember(o =\u003e o.Price, (o, mc) =\u003e o.Count * o.UnitPrice));\n```\n\nMap an object:\n```csharp\nMapper.Map\u003cCustomerDTO\u003e(customer);\n```\nMap an enumerable:\n```csharp\ncustomers.MapTo\u003cCustomer, CustomerDTO\u003e(preserveReferences: true);  // extension methods FTW!\n```\nProject a query:\n```csharp\ncustomerQuery.ProjectTo\u003cCustomerDTO\u003e(checkIncludes: true);\n```\nor with expanding specific navigations:\n```csharp\ncustomerQuery.ProjectTo\u003cCustomer, CustomerDTO\u003e(c =\u003e c.Addresses, c =\u003e c.Orders);\n```\n\nNote: If you want to change mapping behavior, create a class that inherits from ExpressionProvider, override CreateMemberBinding and inject an instance of your class to MapConfiguration.\n\n## Where can I get it?\n\nYou can install [BatMap](https://www.nuget.org/packages/BatMap/) from the package manager console:\n\n```\nPM\u003e Install-Package BatMap\n```\n\n## Documentation\nYou might want to visit [wiki](https://github.com/DogusTeknoloji/BatMap/wiki) for more.\n\n***\n\nDeveloped with :heart: at [Doğuş Teknoloji](http://www.d-teknoloji.com.tr).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdogusteknoloji%2Fbatmap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdogusteknoloji%2Fbatmap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdogusteknoloji%2Fbatmap/lists"}