Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

Missing EnsureLoadedAsync() method on IRepository #3542


User avatar
0
bilalhaidar created

Hi I am following the Development Step by Step using ASP.NET Core and Angular 2.

Towards the end of the tutorial, there is a line of code as:

await _personRepository.EnsureLoadedAsync(person, p => p.Phones);

The method EnsureLoadedAsync() is not present anymore. I replaced it with EnsureCollectionLoadedAsync(). Is that correct?

Also, why do we need this method to be called? Is it something like Include()? Is it because the IRepository.Get() does a lazy load?

Thanks


2 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    Yes it is changed in this issue <a class="postlink" href="https://github.com/aspnetboilerplate/aspnetboilerplate/issues/2202">https://github.com/aspnetboilerplate/as ... ssues/2202</a>. We will update documentation, thanks for informing us.

    We added these methods becasue EF core does not support lazy loading yet.

    Thanks.

  • User Avatar
    0
    bilalhaidar created

    Thanks a lot :)