public override void Validate() { if (string.IsNullOrWhiteSpace(CollectionName)) { CollectionName = "Queue"; } if (string.IsNullOrWhiteSpace(ConnectionString)) { ConnectionString = "mongodb://127.0.0.1/test"; } if (MaxSize == 0) { MaxSize = 2000000; } if (MaxDocuments == 0) { MaxDocuments = 2000; } CollectionName = CollectionName.Replace("_MACHINE", "_" + Environment.MachineName); TestMongoConnection(ConnectionString); }
public override void WriteTo(StringBuilder writer) { if (IndexName == null && CollectionName == null) { throw new NotSupportedException("Either IndexName or CollectionName must be specified"); } if (IsDynamic) { writer .Append("from '") .Append(CollectionName.Replace("'", "\\'")) .Append("'"); } else { writer .Append("from index '") .Append(IndexName) .Append("'"); } if (Alias != null) { writer.Append(" as ").Append(Alias); } }
public override void Validate() { if (IsDisabled) { return; } if (string.IsNullOrWhiteSpace(CollectionName)) { CollectionName = "Audit"; } if (string.IsNullOrWhiteSpace(ConnectionString)) { ConnectionString = "mongodb://127.0.0.1/test"; } CollectionName = CollectionName.Replace("_MACHINE", "_" + Environment.MachineName); TestMongoConnection(ConnectionString); }