Skip to content

TripleG3/ImmutapMap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ImmutaMap

Making the mapping of immutable types easier. Maps between records and classes.

Pull down source to review Tests and get an example of what can be done.

Map various property names. Map various property types. Map attributes on properties. Make your own custom mappings and add them.

See Test Examples:

Examples:

//With Extension
var firstBorn = new Person("Mike", "Doe", 42);
var twin = firstBorn.With(x => x.FirstName, "John");
//or
var twin = firstBorn.With(new {FirstName = "John" });

var item = new Item(Number = 1);
var nextItem = item.With(x => x.Number, number => number++);

//Immutable or not mapped to different immutable or not type
var person = new Person("Mike", "Doe", 42);
var employee = person.To<Employee>();

//Map same properties, different names
var person = new Person("Mike", "Doe", 42);
var employee = person.To<Employee>(config => config.MapName(x => x.FirstName, x => x.Name));

About

A mapping tool that allows mapping of immutable class and records.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages