[Solved] How I can Convert T-SQL to Linq C#


surecModel = Surecler.Select(s=> new  { s.SurecId , s.Damga})
                .Distinct()
                //
                .Join(
                db.WEB_SURECROL.DefaultIfEmpty(),
                SURECDAMGALAR => SURECDAMGALAR.SurecId,
                SURECROLLER => SURECROLLER.SurecID,
                (SURECDAMGALAR, SURECROLLER) => new { SURECDAMGALAR, SURECROLLER })
                //
                .GroupJoin(Surecler.DefaultIfEmpty(),
                surecTanim => new { surecTanim.SURECDAMGALAR.Damga,surecTanim.SURECROLLER.RolId  },
                SUREC_LIST => new { SUREC_LIST.Damga,SUREC_LIST.RolId  },
                (surecTanim,SUREC_LIST) => new {surecTanim,SUREC_LIST }
                )
                //
                .Select(x=> new {
                    x.surecTanim.SURECROLLER.WEB_SURECTANIM.SurecAdi,
                    x.surecTanim.SURECROLLER.WEB_SURECTANIM.SurecTip,
                    x.SUREC_LIST.FirstOrDefault().Damga,
                    x.SUREC_LIST.FirstOrDefault().OnayDurumu,
                    x.surecTanim.SURECROLLER.WEB_ROL.RolAdi,
                    x.SUREC_LIST.FirstOrDefault().SurecComplate,
                    x.SUREC_LIST.FirstOrDefault().SurecAktif,
                    x.SUREC_LIST.FirstOrDefault().RedDurumu,
                    x.SUREC_LIST.FirstOrDefault().Aciklama,
                    x.SUREC_LIST.FirstOrDefault().WEB_KULLANICI.GirisAdi,
                    x.SUREC_LIST.FirstOrDefault().Tarih,
                    x.SUREC_LIST.FirstOrDefault().IDonaypersonel,

                });

Solved…

I would like to use it if you have different suggestion.

solved How I can Convert T-SQL to Linq C#