public void StopBundle(int id)
{
IBundle bundle = bundleRepository.GetBundle(id);
if (bundle == null)
{
throw new BundleException(
String.Format("Bundle not found.BundleId:{0}", id));
}
if (bundle.State != BundleState.Active)
{
throw new BundleException("Bundle is not active.");
}
bundle.Stop();
}