Linq-To-Entities using method to select new object
问题 I try to use the same select query multiple times in my application. For example I have this select statement: _db.tbl_itembundlecontents .Select(z => new SingleItemDTO { amount = z.amount, id = z.id, position = z.position, contentType = new BasicMaterialDTO { id = z.tbl_items.id, img = z.tbl_items.tbl_material.img, name = z.tbl_items.tbl_material.name, namekey = z.tbl_items.tbl_material.namekey, info = z.tbl_items.tbl_material.info, weight = z.tbl_items.tbl_material.weight } }); but i also