Skip to content

Instantly share code, notes, and snippets.

@odinserj
Created May 2, 2012 07:51
Show Gist options
  • Save odinserj/2574877 to your computer and use it in GitHub Desktop.
Save odinserj/2574877 to your computer and use it in GitHub Desktop.
public DeliveryService(ModelContext context)
{
_modelContext = context;
_itemSender = context.Get<EmailDeliverItemSender>();
if (TestMode)
{
_itemSender = context.Get<FileDeliveryItemSender>();
}
}
// Лучше так:
public DeliveryService(ModelContext context, IDeliverItemSender sender)
{
_modelContext = context;
_itemSender = sender;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment