public IList<MenuModel> GetAllMenu() { using (IMMEntities context = new IMMEntities()) { var menuList = from A in context.BASE_FUNCTION join B in context.BASE_MENU on A.FUNCTION_ID equals B.FUNCTION_ID select new MenuModel { Function = new FunctionM…
参考:https://bbs.csdn.net/topics/330032307 数据库里面有一个字典表,这张表里面有id段和对应的名字字段.在另外一个记录的表里面有对应的上述字典表的id,而且有多个字段都含有该id字段.需要将其查出来,并且用名字. 1.第一种写法,不使用 left join SELECT a.id AS '编号', 'STORY' AS '类型' , a.title AS '标题',b.name AS '所属项目' , c.realname AS '创建者', a.estim…