Select multiple columns using Entity Framework

前端 未结 7 1353
逝去的感伤
逝去的感伤 2021-01-31 07:10

Maybe an easy question, but can\'t find it easily so forgive me =) I try to select multiple columns. The statement I use is:

var dataset2 = from recordset in ent         


        
7条回答
  •  时光说笑
    2021-01-31 08:10

    var test_obj = from d in repository.DbPricing
    join d1 in repository.DbOfficeProducts on d.OfficeProductId equals d1.Id
    join d2 in repository.DbOfficeProductDetails on d1.ProductDetailsId equals d2.Id
        select new
        {
        PricingId = d.Id,
        LetterColor = d2.LetterColor,
        LetterPaperWeight = d2.LetterPaperWeight
        };
    
    
    http://www.cybertechquestions.com/select-across-multiple-tables-in-entity-framework-resulting-in-a-generic-iqueryable_222801.html
    

提交回复
热议问题