Asp.net mvc 4 ado.net or lambda?

0

Dear, I am just starting on asp.net mvc 4 programming and the truth is that I feel somewhat lost.

I come from working on Windows Forms and ASP.Net N layers, which used ADO.Net and it made it easier for me to create my Stored Procedures in SQL and link it to ASP.Net. Now that I'm trying to use Razor and lambda, I find it easier in some things and more difficult in others, such as doing a inner join of lambda.

How to pass this inner join to lambda expression?

SELECT fechaEmision
    ,nombreArea
    ,nombreTipoSolicitud
FROM Solicitudes
INNER JOIN TipoSolicitudes ON TipoSolicitudes.TipoSolicitudesID = Solicitudes.TipoSolicitudesID
INNER JOIN Condiciones ON Condiciones.CondicionesID = Solicitudes.CondicionesID
INNER JOIN Areas ON Areas.AreasID = TipoSolicitudes.AreasID
    
asked by Luis Vega 13.10.2017 в 23:45
source

1 answer

1

I know what you mean, for a while I suffered the transition. It will only be a matter of getting used to it, and regarding your question.

By nature I recommend that you start with LINQ since the language that works is almost exactly SQL.

var nuevaSolicitudes = from Solicitudes in sol
                     join TipoSolicitudes in tipo on tipo.TipoSolicitudesID equals sol.TipoSolicitudesID 
                     join Condiciones in con on con.CondicionesID equals sol.CondicionesID 
                     join Areas in area on areas.CondicionesID equals sol.AreasID 
                     select sol.fechaEmision, sol.nombreArea, sol.nombreTipoSolicitud;

Example of Inner Join

    
answered by 14.10.2017 в 00:09