I need to get the entity id from a table, and after put it in an url to redirect the action to another controller. For this I'm adding the following line code.
Dim id = db.Rutas.Where(Function(r) r.sDescripcionRuta = ruta.sDescripcionRuta And r.iIdUnidad = ruta.iIdUnidad).Select(Function(i) i.iIdRuta)
The problem is that, when I put the id value in the redirect action the url that I get is the following:
I know that variable id has the value of the entity id, because I can see it in the Inspection Window, but I don't know how to store this value in the variable.
Dim custQuery = _
From cust In db.Customers _
Where cust.CustomerID.Contains("CA") _
Select cust
ForEach cust In custQuery
Console.WriteLine("Customer ID: " & cust.CustomerID)
Next
None
0 Points
5 Posts
Problem to convert linq to integer
Jul 19, 2013 10:03 PM|hm2109|LINK
Hi everyone.
Who can help me?
I need to get the entity id from a table, and after put it in an url to redirect the action to another controller. For this I'm adding the following line code.
Dim id = db.Rutas.Where(Function(r) r.sDescripcionRuta = ruta.sDescripcionRuta And r.iIdUnidad = ruta.iIdUnidad).Select(Function(i) i.iIdRuta)
The problem is that, when I put the id value in the redirect action the url that I get is the following:
http://localhost:1951/RutaEstados/Create/SELECT%20%0D%0A[Extent1].[iIdRuta]%20AS%20[iIdRuta]%0D%0AFROM%20[dbo].[Rutas]%20AS%20[Extent1]%0D%0AWHERE%20([Extent1].[sDescripcionRuta]%20%3d%20%40p__linq__0)%20AND%20([Extent1].[iIdUnidad]%20%3d%20%40p__linq__1)
I know that variable id has the value of the entity id, because I can see it in the Inspection Window, but I don't know how to store this value in the variable.
Thanks for your help
Participant
1229 Points
608 Posts
Re: Problem to convert linq to integer
Jul 20, 2013 12:45 AM|rimagandhi|LINK
Regards
Rima Gandhi.
Software Developer.