GithubHelp home page GithubHelp logo

mustafasacli / entityframework.audit Goto Github PK

View Code? Open in Web Editor NEW

This project forked from matt-bentley/entityframework.audit

0.0 1.0 0.0 21 KB

Audit framework for Entity Framework Core

C# 100.00%

entityframework.audit's Introduction

EntityFramework.Audit

Audit framework for Entity Framework Core.

This framework demonstrates how the EF ChangeTracker can be used to audit data changes to an application using EF. An example of using Fluent APIs is also provided to configure the audit.

One of the principles of the framework is to allow the consumer to use it without having to apply any base classes to their Entities or DbContext.

Registering the Audit Tracker

The library works by using an AuditTracker to apply changes to an Audit collection. The AuditTracker can be registered and configured using the following code:

services.AddDbContext<WeatherContext>(options =>
{
    options.UseSqlite(Connection);
});
services.AuditDbContext<WeatherContext>(options =>
{
    // entities must be opted-in for auditing
    options.AuditEntity<Document>();
    options.AuditEntity<DocumentVersion>();

    // additional options can be configured per entity
    options.AuditEntity<WeatherForecast>()
           // ignore properties from audit
           .Ignore(e => e.ModifiedDate)
           // configure actions to be audited. All enabled by default
           .AuditActions(AuditActionFlags.Inserted | AuditActionFlags.Deleted);
});

entityframework.audit's People

Contributors

mabentley avatar matt-bentley avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.