Open raffacabofrio opened 5 years ago
Fui testar e retornou pra mim o nome do ganhador
É estranho. Em alguns casos traz o nome. Em outros não.
Vou fazer o seguinte. Vou olhar no banco e confirmar 3 casos concretos em que NÃO traz. Aí fica melhor de rastrear o problema.
Seguem os 3 casos em DEV...
ID: 6B276788-8426-41AD-FD2D-08D676AB31CC LIVRO: Teste Winner 10/01 GANHADOR: William +
ID: B666FCB3-E49D-4CBE-FD2E-08D676AB31CC LIVRO: Teste Winner 10/01 - 02 GANHADOR: William +
ID: 0B478F87-E29D-4521-CD76-08D66DAB3B72 LIVRO: valida dev dezembro 29 GANHADOR: RAFFA3
Esse bug ainda persiste ?
Sim. Eu tentei resolver adicionando alguns includes mas ficou terrivelmente lento e eu nem mandei pr ainda. :-(
Está em aberto ainda. Um pr seria bem vindo. 🙏
Em sáb, 16 de mar de 2019 13:52, Walter Vinicius notifications@github.com escreveu:
Esse bug ainda persiste ?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/SharebookBR/sharebook-backend/issues/198#issuecomment-473564469, or mute the thread https://github.com/notifications/unsubscribe-auth/AKIUoti1uPvy9LoJhcD53igmIF67CZ3eks5vXSFGgaJpZM4aDTK7 .
Tem o código pra análise pra ver onde está o gargalo de performance?
Salve @rmenezes . Eu não subi o código por conta desse problema de performance. Mas ele seria parecido com esse. Porém sem o filtro por BookId. Se liga só...
public Book GetBookWithAllUsers(Guid bookId) { var books = _repository .Get().Include(x => x.User).ThenInclude(u => u.Address) .Include(x => x.UserFacilitator).ThenInclude(u => u.Address) .Include(x => x.BookUsers).ThenInclude(bu => bu.User).ThenInclude(u => u.Address) .Where(x => x.Id == bookId) .ToList();
return books.FirstOrDefault();
}
endpoint: /api/Book/{page}/{items}
Não está trazendo nome do ganhador. Suspeito que seja falta de include.
Talvez esse link ajude: https://stackoverflow.com/questions/10822656/entity-framework-include-multiple-levels-of-properties