Skip to content

Instantly share code, notes, and snippets.

@ankitvijay ankitvijay/Mapper.cs
Last active Aug 18, 2019

Embed
What would you like to do?
public SomeAbstractDto ToDto(SomeAbstractRepository repository)
{
if (repository == null) return null;
return (SomeAbstractDto)ToDto((dynamic)repository);
}
public DerivedSomeDto1 ToDto(DerivedSomeRepository1 repository)
{
return new DerivedSomeDto1
{
SomeRandomProperty1 = repository.SomeRandomProperty1,
SomeRandomProperty2 = repository.SomeRandomProperty2
}
}
.
.
.
public DerivedSomeDto18 ToDto(DerivedSomeRepository18 repository)
{
return new DerivedSomeDto18
{
SomeRandomProperty1 = repository.SomeRandomProperty1
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.