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);
    
Made with ❤️ on ABP v8.2.0-preview Updated on March 25, 2024, 15:11