Esempio n. 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="AuditLogger" /> class.
        /// </summary>
        /// <param name="objectContext">The <see cref="ObjectContext" /> to create the <see cref="AuditLog" /> from.</param>
        /// <param name="configuration">The <see cref="AuditConfiguration" /> to use when creating the <see cref="AuditLog" />.</param>
        public AuditLogger(ObjectContext objectContext, AuditConfiguration configuration)
        {
            if (objectContext == null)
            {
                throw new ArgumentNullException("objectContext");
            }

            ObjectContext = objectContext;
            Configuration = configuration ?? AuditConfiguration.Default;

            AttachEvents();
        }
Esempio n. 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="AuditLogger" /> class.
        /// </summary>
        /// <param name="dbContext">The <see cref="DbContext" /> to create the <see cref="AuditLog" /> from.</param>
        /// <param name="configuration">The <see cref="AuditConfiguration" /> to use when creating the <see cref="AuditLog" />.</param>
        public AuditLogger(DbContext dbContext, AuditConfiguration configuration)
        {
            if (dbContext == null)
            {
                throw new ArgumentNullException("dbContext");
            }

            var adapter = (IObjectContextAdapter)dbContext;

            ObjectContext = adapter.ObjectContext;
            Configuration = configuration ?? AuditConfiguration.Default;

            AttachEvents();
        }
Esempio n. 3
0
 internal AuditEntityConfiguration(AuditConfiguration auditConfiguration)
 {
     _auditConfiguration = auditConfiguration;
 }