Hello, I am trying to reference a set of tables to be able to use the data of some records. For this he used the following:
void asociarcamposforms() {
var idpedido = Convert.ToDecimal(Request.QueryString["idpedido"]);
var queryObtenerdtpedido = db.detalle_pedido.Where(dt => dt.id_pedido == idpedido);
var pedido = queryObtenerdtpedido.FirstOrDefault();
var idarticulo = pedido.articuloid;
var queryObtenerArticulo = db.articuloes.Where(p => p.articuloid == idarticulo);
var articulos = queryObtenerArticulo.FirstOrDefault();
}
works perfectly, but I would like to know if there is any way to reduce all that procedure I do. This is just a fragment of code the other processes are conditions and methods