Skip to content

Latest commit

 

History

History
57 lines (45 loc) · 2.02 KB

README.md

File metadata and controls

57 lines (45 loc) · 2.02 KB

EFCoreAuditing

Hits GitHub issues Build Status PRs Welcome nuget

A Library for EntityFrameworkCore to support automatically recording data changes history (audit logging), soft-delete, and Snakecase naming convention functionality.

📦 Installation

EFCore.Auditing is available on NuGet.

dotnet add package EFCore.Auditing

🚀 How to use

EFCoreAuditing will recording all the data changing history in one table named 'Audit'.

1. Enable Audit log with using AuditLogDbContext
public class UserDbContext : AuditLogDbContext<Guid>
{
   public UserDbContext(DbContextOptions<UserDbContext> dbOptions) 
       : base(dbOptions)
   {
   }

   public DbSet<Blog> Blogs { get; set; }
   public DbSet<Post> Posts { get; set; }
   
   protected override void OnModelCreating(ModelBuilder builder)
   {
       base.OnModelCreating(builder);
       
       builder
           .SnakeCaseifyNames() //Change all the table names and column names to snake_case.
           .EnableSoftDelete(); //Enable soft-delete functionality.
   }
}

✨ Contributors

GitHub Contributors Image

🤝 Contributing

  1. Fork it ( https://github.com/OKTAYKIR/EFCoreAuditing/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Show your support

Please ⭐️ this repository if this project helped you!

📝 License

MIT License