Skip to content

Instantly share code, notes, and snippets.

@yemrekeskin
Last active December 15, 2015 10:59
Show Gist options
  • Save yemrekeskin/5249696 to your computer and use it in GitHub Desktop.
Save yemrekeskin/5249696 to your computer and use it in GitHub Desktop.
public class DomesticPaymentRepository
: BaseRepository<Payment>
{
}
public class ForeignPaymentRepository
:BaseRepository<Payment>
{
}
public class TreasuryRepository
:BaseRepository<Payment>
{
}
public class UniversalRepository
{
// repositories
private DomesticPaymentRepository _domestic;
private ForeignPaymentRepository _foreign;
private TreasuryRepository _treasury;
public DomesticPaymentRepository DomesticPaymentRepository
{
get
{
if (null == _domestic)
_domestic = new DomesticPaymentRepository();
return _domestic;
}
}
public ForeignPaymentRepository ForeignPaymentRepository
{
get
{
if (null == _foreign)
_foreign = new ForeignPaymentRepository();
return _foreign;
}
}
public TreasuryRepository TreasuryRepository
{
get
{
if (null == _treasury)
_treasury = new TreasuryRepository();
return _treasury;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment