Entity framework left join

var query = (from u in _StyleSizeRepository.GetAll()
                    join p in _buyCentralRepository.GetAll() on u.Barcode equals p.BarCode into gj
                    from x in gj.DefaultIfEmpty()
                    select new StyleSize()
                    {
                        Barcode = u.Barcode,
                        sBarcode = u.sBarcode,
                        BTID = u.BTID,
                        BTName = u.BTName,                      
                        BalQty = (x == null ? 0 : x.balQty)
                    });

http://stackoverflow.com/questions/5537995/entity-framework-left-join

Comments

Popular posts from this blog

How to use DbFunctions.TruncateTime

Microsoft Access Connectivity from C#

Tool 'dotnet-ef' failed to install. dotnet core