LINQ is a language for querying only, it "does not allow" you to make changes to collections of data.
So to solve your problem you would ideally make a query for the "products" that correspond to the "budgets", put this result into an object and at the end of the query join all those objects into a collection. You would then use a foreach
in this collection to update the data.
See the example below how to do this. Assuming you have the classes below:
public class Produto
{
public int Id { get; set; }
public int Estoque { get; set; }
}
public class Orcamento
{
public int Id { get; set; }
public int Quantidade { get; set; }
}
Define a class to match the corresponding "product" and "budget":
public class ProdutoOrcamento
{
public Produto Produto { get; set; }
public Orcamento Orcamento { get; set; }
}
Query, store the result, and through a foreach
update the data in the Product instance:
var produtosOrcamentos = (from o in orcamentos
join p in produtos on o.Id equals p.Id
select new ProdutoOrcamento { Produto = p, Orcamento = o });
foreach (var i in produtosOrcamentos)
{
i.Produto.Estoque = i.Orcamento.Quantidade;
}