Skip to content

Instantly share code, notes, and snippets.

@ankitvijay
Last active August 18, 2019 06:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ankitvijay/faa37402c6b3d5d441259e24ceb34d12 to your computer and use it in GitHub Desktop.
Save ankitvijay/faa37402c6b3d5d441259e24ceb34d12 to your computer and use it in GitHub Desktop.
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