Пример #1
0
        public void Auditing()
        {
            var mongo = MongoServer.Create(_MongoConnectionString);
            MongoAppenderInit.Provider().Init();
            var audits = mongo.GetDatabase("auditing").GetCollection<AuditEntry>("audits");

            var bob = new Employee{ Name = "bob" };
            var promotion = new PromoteEmployee {Level = Employee.EmployeeLevel.God};

            var audit = new AuditEntry(promotion, bob) {UserName = "******"};
            audits.Insert(audit);
        }
Пример #2
0
        public void Auditing()
        {
            var mongo = MongoServer.Create(_MongoConnectionString);

            MongoAppenderInit.Provider().Init();
            var audits = mongo.GetDatabase("auditing").GetCollection <AuditEntry>("audits");

            var bob = new Employee {
                Name = "bob"
            };
            var promotion = new PromoteEmployee {
                Level = Employee.EmployeeLevel.God
            };

            var audit = new AuditEntry(promotion, bob)
            {
                UserName = "******"
            };

            audits.Insert(audit);
        }