Skip to content

Instantly share code, notes, and snippets.

@ankitvijay

ankitvijay/Mapper.cs

Created Aug 18, 2019
Embed
What would you like to do?
public SomeAbstractDto ToDto(SomeAbstractRepository repository)
{
if (repository == null) return null;
case DerivedSomeDto1 derivedSomeDto1 :
return ToDto(derivedSomeDto1);
.
.
.
case DerivedSomeDto18 derivedSomeDto18:
return ToDto(derivedSomeDto18);
default:
throw InvalidOperationException("Operation not supported for given input");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment