Base solution for your next web application
Open Closed

Extending the IAuditedEntity #2053


User avatar
0
worthyvii created

Hello,

I would like to add IP Address to the information saved on a table. How would I do this?


2 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    You can check definition and usage of ICreationAudited interface for this in ABP Framework. You can define an interface just like ICreationAudited and use it in your entities.

    Then override SetCreationAuditProperties method of your DbContext and do whatever you want in it. Don't forgot to call base method in overriden SetCreationAuditProperties of yours :).

    See usage of ICreationAudited interface here <a class="postlink" href="https://github.com/aspnetboilerplate/aspnetboilerplate/blob/52020f9d154752c09d9aa2c7ef8a5a44a5ede21a/src/Abp.EntityFrameworkCore/EntityFrameworkCore/AbpDbContext.cs#L297">https://github.com/aspnetboilerplate/as ... xt.cs#L297</a>

  • User Avatar
    0
    worthyvii created

    Thanks so much!