Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

2 Commits

Repository files navigation

AutoMapper.SourceGenerator

It is just a simple AutoMapper that uses c# 9 source generator. It is not production ready nor optimized.


How to use

It create method for Mapping two object type, you have to create a partial class and specify which type you want to map by using Map Attribute

[Map(typeof(MapGeneratorTests.User),typeof(MapGeneratorTests.UserDto))]publicstaticpartialclassMappers{}

and The generated class will be like

publicstaticpartialclassMappers{publicstaticvoidConvert(Mapper.Tests.MapGeneratorTests.UserinputObj,outMapper.Tests.MapGeneratorTests.UserDtooutputObj){outputObj=newMapper.Tests.MapGeneratorTests.UserDto();outputObj.Username=inputObj.Username;outputObj.Id=inputObj.Id;}}

About

No description or website provided.

Topics

Resources

Stars

2 stars

Watchers

1 watching

Forks

Contributors

Languages