public bool Save(IAData data) { if (data == null) throw new NullReferenceException("data"); if (writeColl.FindOne(Query.EQ("_id", ObjectId.Parse(data._id.ToString()))) != null) { Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine("Exists::::::::::::::::::::::::::" + data.IAID); Console.ResetColor(); } var result = writeColl.Insert(data); return true; }
public bool Save(IAData data) { if (data == null) { throw new NullReferenceException("data"); } if (writeColl.FindOne(Query.EQ("_id", ObjectId.Parse(data._id.ToString()))) != null) { Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine("Exists::::::::::::::::::::::::::" + data.IAID); Console.ResetColor(); } var result = writeColl.Insert(data); return(true); }