AutoCrud with AuditBase on child table

I have a table that references a child table (one to many) where they both derive from AuditBase and use [AutoApply(Behavior.AuditCreate)] on the Create DTO’s.

When sending a create DTO for the parent table, and have the child DTO list populated, when it tries to create the child row, it’s not populating all the Audit fields on that child table.

I’m getting this error:
23502: null value in column “created_by” of relation “schedules” violates not-null constraint

where schedules is the referenced table. Does AutoQuery actually use the CreateSchedule DTO where [AutoApply(Behavior.AuditCreate)] attribute is? Or how would it go about filling in the audit fields for that child table?

`[ValidateIsAuthenticated]
[AutoApply(Behavior.AuditCreate)]
[Route("/treatments", "POST")]
public partial class CreateTreatments :
   IReturn<IdResponse>, IPost, ICreateDb<Treatments>
{
...
[Reference]
public List<Schedules>? Schedules { get; set; }
... `

` [ValidateIsAuthenticated]
[AutoApply(Behavior.AuditCreate)]
[Route("/schedules", "POST")]
public partial class CreateSchedules
          : IReturn<IdResponse>, IPost, ICreateDb<Schedules>
{
...`

And then the actual POCO:
`public partial class Schedules : AuditBase
{
    [PrimaryKey]
    [AutoId]
    public Guid Id { get; set; }
   ...
    [References(typeof(Treatments))]
    public Guid? TreatmentId { get; set; }
   ...`

And the parent table POCO:

public partial class Treatments : AuditBase
{
        [PrimaryKey]
        [AutoId]
        public Guid Id { get; set; }
        ...
        [Reference]
        public List<Schedules>? Schedules { get; set; }
}

This functionality isn’t supported by default, you will need a custom AutoQuery service to manage the default values of the referenced tables that are being inserted. Those behaviors only apply to the APIs AutoQuery table. The [Reference] attribute is to be used with your model classes, rather than your Request DTOs.

Your custom implementation can still use IAutoQueryDb with so your code should look something like:

public IAutoQueryDb AutoQuery { get;set; }

public object Post(CreateTreatments request)
{
   foreach(var schedule in request.Schedules) 
   {
      // Your logic
   }
   return AutoQuery.Create(request, base.Request);
}

I appreciate the answer!