All Projects → maurosampietro → UltraMapper

maurosampietro / UltraMapper

Licence: other
A fast and lightweight object-to-object .NET mapper.

Programming Languages

C#
18002 projects

Projects that are alternatives of or similar to UltraMapper

Change By Example
Finds a function that transforms a given object into another given object.
Stars: ✭ 32 (+14.29%)
Mutual labels:  map, mapper
awesome-maps-ukraine
A curated list of maps of Ukraine, ukrainian mappers and tools that they use or develop for creating and publish maps
Stars: ✭ 35 (+25%)
Mutual labels:  map, mapper
Mapper
A simple and easy go tools for auto mapper map to struct, struct to map, struct to struct, slice to slice, map to slice, map to json.
Stars: ✭ 175 (+525%)
Mutual labels:  map, mapper
eurostat-map.js
Reusable library to quickly create and customise web maps showing Eurostat data directly retrieved from Eurostat database.
Stars: ✭ 32 (+14.29%)
Mutual labels:  map
nycbikemap
A web-based, unified, interactive bike map for NYC that combines information from NYC OpenData, Citi Bike and other sources.
Stars: ✭ 15 (-46.43%)
Mutual labels:  map
ChinaMapView
自定义View,可缩放、可平移、可点击的中国地图,有中国地图的全部省份,具备每个省份的点击接口
Stars: ✭ 1,211 (+4225%)
Mutual labels:  map
OS-Open-Zoomstack-Stylesheets
Cartographic Stylesheets for OS Open Zoomstack
Stars: ✭ 36 (+28.57%)
Mutual labels:  map
amap
行政区域查询,根据经纬度快速地查找特定的行政区域信息、省市区信息、中国省市区数据。Administrative region query: to quickly find specific administrative region information based on latitude and longitude provincial information urban China data
Stars: ✭ 31 (+10.71%)
Mutual labels:  map
Minemap
An efficient map viewer for Minecraft seed in a nice GUI with utilities without ever needing to install Minecraft.
Stars: ✭ 104 (+271.43%)
Mutual labels:  map
CXProvincesMapView
一个基于PaintCode绘制的中国省份地图框架
Stars: ✭ 49 (+75%)
Mutual labels:  map
g910-gkey-macro-support
GKey support for Logitech G910 Keyboard on Linux
Stars: ✭ 85 (+203.57%)
Mutual labels:  mapper
Detached-Mapper
An ORM friendly mapper. Allows saving entire entity graphs. Heavily inspired in GraphDiff and AutoMapper.
Stars: ✭ 89 (+217.86%)
Mutual labels:  mapper
atlas-for-rust
Atlas is an unofficial interactive map experience for Rust.
Stars: ✭ 34 (+21.43%)
Mutual labels:  map
AutoMapper.Contrib.Autofac.DependencyInjection
Autofac plug-in for AutoMapper.
Stars: ✭ 14 (-50%)
Mutual labels:  object-to-object
telegram-nearby-map
Discover the location of nearby Telegram users 📡🌍
Stars: ✭ 329 (+1075%)
Mutual labels:  map
geo-tree
High performance library for geographical map-related operations
Stars: ✭ 51 (+82.14%)
Mutual labels:  map
Overseer
Tool for analyzing Starcraft 2 maps by region decomposition
Stars: ✭ 13 (-53.57%)
Mutual labels:  mapper
flowing-terrain
Algorithm for creating 3 dimensional terrain maps and their likely watercourses.
Stars: ✭ 27 (-3.57%)
Mutual labels:  map
AlamofireMapper
Mapper for Alamofire use Swift 4 decoable
Stars: ✭ 18 (-35.71%)
Mutual labels:  mapper
localizator
Localizator is a flutter application that provides your current/given position,and gives you weather Forecasts
Stars: ✭ 46 (+64.29%)
Mutual labels:  map

UltraMapper

Build status NuGet

A nicely coded object-mapper for .NET

What is UltraMapper?

UltraMapper is a .NET mapper, that is, a tool that avoids you the need to write the code needed to copy values from a source object to a target object. It avoids you the need to manually write the (boring) code that reads the value from the source and instantiate/assign the relative member on the target object.

It can be used to get deep copies of an object or map an object to another type.

Consider this simple class:

public class Person
{
    public DateTime Birthday { get; set; }
    public string FirstName { get; set; }
    public string LastName { get; set; }
    public string EmailAddress { get; set; }
}

If you wanted a copy of an instance of the above class your should write something like this:

var clone = new Person();
clone.Birthday = person.Birthday
clone.FirstName = person.FirstName
clone.LastName = person.LastName
clone.EmailAddress = person.EmailAddress

What if you had hundreds of simple objects like the one above to copy? What if the object was more complex, contained references to other complex objects or collections of other complex objects?

Would you still map it manually!? With UltraMapper you can solve this problem efficiently like this:

UltraMapper ultraMapper = new UltraMapper();
Person clone = ultraMapper.Map<Person>( person );

Getting started

Check out the wiki for more information and advanced scenarios

Why should I use UltraMapper instead of known alternatives like AutoMapper, ExpressMapper or TinyMapper?

The answer is ReferenceTracking, Reliability, Performance and Maintainability.

The ReferenceTracking mechanism of UltraMapper guarantees that the cloned or mapped object preserve the same reference structure of the source object: if an instance is referenced twice in the source object, we will create only one new instance for the target, and assign it twice.

This is something theorically simple but crucial, yet uncommon among mappers; in facts other mappers tipically will create new instances on the target even if the same instance is being referenced twice in the source.

With UltraMapper, any reference object is cached and before creating any new reference a cache lookup is performed to check if that instance has already been mapped. If the reference has already been mapped, the mapped instance is used.

This technique allows self-references anywhere down the hierarchical tree of the objects involved in the mapping process, avoids StackOverflows and guarantees that the target object is actually a deep copy or a mapped version of the source and not just a similar object with identical values.

ReferenceTracking mechanism is so important that cannot be disabled and offers a huge performance boost in real-world scenarios.

UltraMapper is just ~1100 lines of code and generates and compiles minimal mapping expressions. MappingExpressionBuilders are very well structured in a simple object-oriented way.

Key features

Implemented features:

  • Powerful reference tracking mechanism
  • Powerful type/member configuration override mechanism, with configuration inheritance
  • Supports self-references and circular references, anywhere down the object hierarchy
  • Supports object inheritance
  • Supports abstract classes
  • Supports interfaces
  • Supports mapping by convention
  • Supports flattening/projections by convention
  • Supports manual flattening/unflattening/projections.
  • Supports arrays
  • Supports collections (Dictionary, HashSet, List, LinkedList, ObservableCollection, SortedSet, Stack, Queue)
  • Supports collection merging/updating

Moreover UltraMapper is:

  • very fast in any scenario (faster than any other .NET mapper i tried). See the benchmarks.
  • developer-friendly (should be easy to contribute, extend and maintain)

ANY FEEDBACK IS WELCOME

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].