protected override void ProcessRecord() { if (_Query == null) { throw new PSArgumentException(TextParameterQuery); //_131121_104038 } try { WriteResult(TargetCollection.Remove(_Query, _Flags, WriteConcern, Result)); } catch (MongoException ex) { WriteException(ex, null); } }
bool RemoveTarget (Guid id) { bool res = false; if (id.NotEmpty ()) { if (HasContentTarget) { foreach (var item in TargetCollection) { if (item.Id.Equals (id)) { TargetCollection.Remove (item); res = true; break; } } } } return (res); }