BEST
DEALS
OF THE
YEAR!
SAVE UP TO $3,000
24 NOV
1 DEC
00 Days
00 Hrs
00 Min
00 Sec
Open Closed

Create a New Record in a table if a Specific EntityChanges from an AuditLog Context #7730


User avatar
0
WilliamT created
  • ABP Framework version: v6.0.2
  • UI Type: MVC
  • Database System: EF Core
  • Tiered (for MVC) or Auth Server Separated (for Angular): yes
  • Exception message and full stack trace:
  • Steps to reproduce the issue:

I want to create a record on a table when there is a POST method from multiple selected entity. Currently I use AuditLogContributor > PostContribute to find the entity that i want, but how do I connect it to an appService or repository to create the new record ?


2 Answer(s)
  • User Avatar
    0
    WilliamT created

    i just found out i can call the following in PostContribute context.ServiceProvider.GetRequiredService and just call the function i want. would that be an ok approach ?

  • User Avatar
    0
    liangshiwei created
    Fullstack Developer

    Hi,

    You can use context.ServiceProvider.GetRequiredService to get any services from the IOC container.

Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.1.0-preview. Updated on November 20, 2025, 09:12
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.