Open Closed

CreationTime and CreatorId is not inserting in case of InsertManyAsync #6096


User avatar
0
Priyanka created
  • ABP Framework version: vX.X.X
  • UI Type: React
  • Database System: EF Core (SQL Server)
  • Tiered (for MVC) or Auth Server Separated (for Angular): no
  • Exception message and full stack trace: There is no exception message
  • Steps to reproduce the issue: Call insert Many

In case of insert using abp, creation time and creator id is updating automatically, but in case of insert many, creator id and creation time is not inserting, as it is get only field, I'm not able to assign any value. Please help me with the solution.


1 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    ObjectHelper.TrySetProperty(your_entity, x => x.CreatorId, () => CurrentUser.Id);
    ObjectHelper.TrySetProperty(your_entity, x => x.CreationTime, () => Clock.Now);
    
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
Do you need assistance from an ABP expert?
Schedule a Meeting
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v9.2.0-preview. Updated on March 18, 2025, 10:42