Ao rodar a aplicação ela apresentou esse erro. o que poderia estar ocorrendo?
An unhandled exception occurred while processing the request.
InvalidOperationException: Sequence contains more than one element
System.Linq.Enumerable.SingleOrDefault<TSource>(IEnumerable<TSource> source)
Stack Query Cookies Headers
InvalidOperationException: Sequence contains more than one element
System.Linq.Enumerable.SingleOrDefault<TSource>(IEnumerable<TSource> source)
lambda_method(Closure , QueryContext )
Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler+<>c__DisplayClass17_1.<CompileQueryCore>b__0(QueryContext qc)
System.Linq.Queryable.SingleOrDefault<TSource>(IQueryable<TSource> source)
CasaDoCodigo.Repositories.PedidoRepository.AddItem(string codigo) in PedidoRepository.cs
+
var produto = contexto.Set<Produto>().Where(p => p.Codigo == codigo).SingleOrDefault();
CasaDoCodigo.Controllers.PedidoController.Carrinho(string codigo) in PedidoController.cs
+
pedidoRepository.AddItem(codigo);