Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bramerdaniel/MagicMap
https://github.com/bramerdaniel/MagicMap
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/bramerdaniel/MagicMap
- Owner: bramerdaniel
- License: mit
- Created: 2023-02-24T08:01:16.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2023-09-08T10:11:42.000Z (over 1 year ago)
- Last Synced: 2024-08-01T22:43:30.922Z (4 months ago)
- Language: C#
- Size: 307 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- RSCG_Examples - https://github.com/bramerdaniel/MagicMap
README
# MagicMap
SourceGenerator based package for generating boilerplate code like object mappers
This is still under construction
Mapping code from one class to another
```C#
public class Person
{
public string Name { get; set; }
public int Age { get; set; }
}public class PersonModel
{
public string Name { get; set; }
public int Age { get; set; }
}```
The required code to write
```C#
[TypeMapper(typeof(Person), typeof(PersonModel))]
internal partial class PersonMapper { }
```Usage
```C#
var source = new Person { Name = "Peter", Age = 34 };
var model = source.ToPersonModel();
```