public void PutbackItemList(int fingerPrint, IDAndPubInfo[] items) { if (!dict.ContainsKey(fingerPrint)) dict.Add(fingerPrint, items); else dict[fingerPrint] = items; }
public void PutbackItemList(int fingerPrint, IDAndPubInfo[] items) { var collection = MongoDBManager.GetCollections(collectionName); IMongoQuery query = Query.And(Query.EQ("FingerPrint", fingerPrint), Query.EQ("CollectionTag", collectionTag)); var result = collection.FindOneAs<FingerPrintList>(query); if (result != null) collection.Remove(query, SafeMode.False); result = new FingerPrintList(); result.FingerPrint = fingerPrint; result.CollectionTag = collectionTag; result.Items = items; collection.Insert(result, SafeMode.False); }