Closed morne-insight closed 11 months ago
Hi @morne-insight,
You're pretty close, but it needs a reference to the EF NuGet package, so shouldn't be done directly from the Application
project (which should be as technology agnostic as possible), instead it can be done in a repository method implementation in the infrastructure project.
A method would be added to that repository's interface, something like FindByIdAndIncludeMonthToDate(Guid id)
, then the implementation of that method would be something like:
return await FindAsync(x => x.PlanVersionId == id, x => x.Include(y => y.MonthToDateSale), cancellationToken);
Ask a question
I am trying to find a record using the FindAsync method that was generated by Intent as part of the Repository pattern.
I can retrieve the record that I'm looking for but would like to use EF's
.Include(…)
extension method with the child entity.Here is what I am currently trying but I'm getting an error.
var actuals = await _actualMetaRepository.FindAsync(x => x.PlanVersionId == plan.Id, x => x.Include("MonthToDateSale"), cancellationToken);