Skip to content

Instantly share code, notes, and snippets.

View aaronbarnaby's full-sized avatar

Aaron Barnaby aaronbarnaby

View GitHub Profile
@aaronbarnaby
aaronbarnaby / MappingExtentions.cs
Created April 6, 2021 12:34
Mapping Extension class for handling multiple sources to destination.
public static class MappingExtentions
{
public static TDestination Map<TDestination>(this IMapper mapper, params object[] sources) where TDestination : new()
{
return Map(mapper, new TDestination(), sources);
}
public static TDestination Map<TDestination>(this IMapper mapper, TDestination destination, params object[] sources) where TDestination : new()
{
if (!sources.Any())

Keybase proof

I hereby claim:

  • I am aaronbarnaby on github.
  • I am barnabyaaron (https://keybase.io/barnabyaaron) on keybase.
  • I have a public key ASD0zcMmVHl0O6QkrwW9OcTTTo5D-SG-mr3lH5u-0pP-vwo

To claim this, I am signing this object: