Skip to content

Code difference in blog and repository #9

@cseas

Description

@cseas

Code for ReservationRepository.cs is different.

In the blog:

public async Task<List<T>> GetAll<T>()
{
    return await _myHotelDbContext
        .Reservations
        .Include(x => x.Room)
        .Include(x => x.Guest)
        .ProjectTo<T>()
        .ToListAsync();
}

In the repository:

public async Task<List<T>> GetAll<T>()
{
    return await GetQuery().ProjectTo<T>().ToListAsync();
}

Which one to use? Is the blog outdated or the repo?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions