private void CheckInstanceValue(object value) { if (value == null) return; if (!ServiceType.IsInstanceOfType(value)) throw new ArgumentException(String.Format("The provided instance is not assignable from service type '{0}'",ServiceType)); }