Find doesn't return my collection
Shift contains a property:
I'm trying to add them to
But when I get Shift using
QualificationsQualificationsI'm trying to add them to
ShiftsShifts and it works!But when I get Shift using
FindCoreAsyncFindCoreAsync QualificationsQualifications in nullprotected override async Task AddCoreAsync(Shift shift, EventHandlingContext context)
{
shift.Created = timeProvider.GetUtcNow().DateTime;
dbContext.Shifts.Add(shift);
dbContext.ShiftQualifications.AddRange(shift.Qualifications!);
await dbContext.SaveChangesAsync(context.CancellationToken).ConfigureAwait(false);
}
public override async Task<Shift?> FindCoreAsync(Shift shift, EventHandlingContext context)
{
var foundShift = await dbContext.Shifts
.AsNoTracking()
.FirstOrDefaultAsync(
s => s.ScheduledStart == shift.ScheduledStart
&& s.Type == shift.Type
&& s.ResourceId == shift.ResourceId,
context.CancellationToken)
.ConfigureAwait(false);
return foundShift;
}protected override async Task AddCoreAsync(Shift shift, EventHandlingContext context)
{
shift.Created = timeProvider.GetUtcNow().DateTime;
dbContext.Shifts.Add(shift);
dbContext.ShiftQualifications.AddRange(shift.Qualifications!);
await dbContext.SaveChangesAsync(context.CancellationToken).ConfigureAwait(false);
}
public override async Task<Shift?> FindCoreAsync(Shift shift, EventHandlingContext context)
{
var foundShift = await dbContext.Shifts
.AsNoTracking()
.FirstOrDefaultAsync(
s => s.ScheduledStart == shift.ScheduledStart
&& s.Type == shift.Type
&& s.ResourceId == shift.ResourceId,
context.CancellationToken)
.ConfigureAwait(false);
return foundShift;
}