Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.

SQL query to LINQ

[es] :: .NET :: SQL query to LINQ

[ Pregleda: 910 | Odgovora: 1 ] > FB > Twit

Postavi temu Odgovori

Autor

Pretraga teme: Traži
Markiranje Štampanje RSS

pl4stik
Senior .NET programmer/Consultant
oDesk
NI na nebu NI na zemlji

Član broj: 173596
Poruke: 715
*.exe-net.net.

Sajt: xx-auth.com.azhar.arvixe...


+31 Profil

icon SQL query to LINQ29.05.2020. u 00:38 - pre 47 meseci
Pozdrav

Jel moze neko da mi pomogne oko pisanje ovakvog SQL-a u LINQ
Code:

select 
    s4.serial, 
    s4.serviceguid, 
    s4.info0, 
    s4.info1, 
    s4.info2, 
from services4 s4
left outer join services4connections s4c on s4c.serviceguid = s4.serviceguid and s4c.deleted = 0


Ovo sam ja uradio

Code:

            services4.GroupJoin(
                services4connections,
                s => new { s.serviceguid },
                cs => new { cs.serviceguid },
                (services, sconnection) => new { Services4 = services, Services4connections = sconnection })
                .SelectMany(
                x => x.Services4connections.DefaultIfEmpty(),
                (services, sconnection) => new { computer = services.Services4, folder = sconnection })


i to generise
Code:

SELECT 
    [Extent1].[serial] AS [serial],  
    [Extent1].[serviceguid] AS [serviceguid], 
    [Extent1].[info0] AS [info0], 
    [Extent1].[info1] AS [info1], 
    [Extent1].[info2] AS [info2], 
    FROM  [dbo].[services4] AS [Extent1]
    LEFT OUTER JOIN [dbo].[services4connections] AS [Extent2] ON [Extent1].[serviceguid] = [Extent2].[serviceguid]




Znaci ovo na kraju
Citat:
and s4c.deleted = 0
nikako ne mogu da napravim evo drugi ceo dan pa molim za pomoc ako neko zna..

Unapred hvala
To sto nekoliko miliona ljudi tvrdi da nisi u pravu ne znaci da stvarno nisi - Frank Zappa

https://youtu.be/DLe358DPGXU
 
Odgovor na temu

pl4stik
Senior .NET programmer/Consultant
oDesk
NI na nebu NI na zemlji

Član broj: 173596
Poruke: 715
*.exe-net.net.

Sajt: xx-auth.com.azhar.arvixe...


+31 Profil

icon Re: SQL query to LINQ29.05.2020. u 08:28 - pre 47 meseci
Reseno :)
Code:

            services4.GroupJoin(
                services4connections.Where(z => z.deleted == false),
                s => new { s.serviceguid },
                cs => new { cs.serviceguid },
                (services, sconnection) => new { Services4 = services, Services4connections = sconnection })
                .SelectMany(x => x.Services4connections.DefaultIfEmpty(),
                (services, sconnectio) => new { computer = services.Services4, folder = sconnectio })
              




[Ovu poruku je menjao pl4stik dana 29.05.2020. u 11:13 GMT+1]
To sto nekoliko miliona ljudi tvrdi da nisi u pravu ne znaci da stvarno nisi - Frank Zappa

https://youtu.be/DLe358DPGXU
 
Odgovor na temu

[es] :: .NET :: SQL query to LINQ

[ Pregleda: 910 | Odgovora: 1 ] > FB > Twit

Postavi temu Odgovori

Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.