Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on package Npgsql.EntityFrameworkCore.PostgreSQL 6.0.0 #4129

Closed
JimmyNobre opened this issue Nov 11, 2021 · 2 comments
Closed

Error on package Npgsql.EntityFrameworkCore.PostgreSQL 6.0.0 #4129

JimmyNobre opened this issue Nov 11, 2021 · 2 comments

Comments

@JimmyNobre
Copy link

I installed Visual Studio 2022 and .net6 with PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="6.0.0".

After this, the system started to give errors and closed applications. Part of code that have error is this:

            var saldoEstoque2 =
                (from p in _db.Produtos
                 where (p.EmpresaId == empresaId && p.Id == produtoId)
                 join d in _db.Deposito on p.EmpresaId equals d.EmpresaId
                 group p by new { p.EmpresaId, ProdutoId = p.Id, DepositoId = d.Id, DepositoNome = d.Nome } into g
                 select
                 new
                 {
                     g.Key.EmpresaId,
                     g.Key.ProdutoId,
                     g.Key.DepositoId,
                     g.Key.DepositoNome,
                     Soma = (from k in _db.Kardex
                             where ((k.DataMovimento.Date > DataUltimoFechamento && k.DataMovimento.Date <= dataReferencia) &&
                                     k.EmpresaId == g.Key.EmpresaId &&
                                     k.ProdutoId == g.Key.ProdutoId &&
                                     k.DepositoId == g.Key.DepositoId)
                             group k by new { k.EmpresaId, k.ProdutoId, k.DepositoId } into gk
                             select gk.Sum(s => s.QtdeMovimento)).FirstOrDefault(),
                     Fech = (from f in _db.FechamentoEstoqueProduto
                             join d in _db.FechamentoEstoque on f.FechamentoEstoqueId equals d.Id
                             where (d.DataFechamento.Date == DataUltimoFechamento &&
                                    f.EmpresaId == g.Key.EmpresaId &&
                                    f.ProdutoId == g.Key.ProdutoId &&
                                    f.DepositoId == g.Key.DepositoId)
                             group f by new { f.EmpresaId, f.ProdutoId, f.DepositoId } into gf
                             select gf.Sum(s => s.Saldo)).FirstOrDefault()
                 });
@roji
Copy link
Member

roji commented Nov 11, 2021

@JimmyNobre you'll need to post the full exception stack trace, and ideally also a runnable code sample (including the model) - it's not possible to investigate this just given a query.

Also, there's a good chance this isn't PostgreSQL-specific in any way, so I'd start with opening the issue on the EF Core repo (but again, please post the full details).

@roji
Copy link
Member

roji commented Dec 29, 2021

Closing as no response was provided.

@roji roji closed this as completed Dec 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants