Exemplo n.º 1
0
        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;
        }
Exemplo n.º 2
0
        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);
        }