Quantcast
Channel: ADO.NET, Entity Framework, LINQ to SQL, NHibernate
Viewing all articles
Browse latest Browse all 1698

Convert linq to sql query

$
0
0

Hi , I struggle to convert a query from linq to sql ,

my query is:

 from box in _context.MailIteboxStore.Where(x => x.boxId == boxId)
                .Include(x => x.boxItem).ThenInclude(x => x.boxItemGen)
                .Include(x => x.boxItem).ThenInclude(x => x.boxItemQ).ThenInclude(x => x.Qualifing)
                join itm in _context.ItemStore
                            .Include(x => x.occurrence).ThenInclude(x => x.ExternalKey)
                            .Include(x => x.occurrenceType)
                            .Include(x => x.Store) on box.boxItemId equals itm.itmId
                join c in _context.occurrenceAttribute.Where(x => x.Attribute.Code == "NEW")
                select new boxItemBoxDetails
                {
                    boxItem = box.boxItem,
                    ItemStore = itm,
               }

I cannot able to render several join and left join to correct sql 

Can anyone help me?

Thanks


Viewing all articles
Browse latest Browse all 1698

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>