public async Task <IEnumerable <SceneSegmentSubSearchModel> > GetSceneSegmentsBySceneIdAsync(int sceneId) { var queryData = _context.SceneSegments.Where(s => s.SceneId == sceneId); var result = QueryOperate <SceneSegment> .Execute(queryData); var sceneSegments = await result.ToListAsync(); var sceneSegmentsSearch = SceneSegmentOperator.SetSceneSegmentSubSearchModel(sceneSegments); return(sceneSegmentsSearch); }
public SceneSegmentSearchModel FindById(int sceneSegmentId) { var result = _context.SceneSegments.Where(v => v.SceneSegmentId == sceneSegmentId); result = (IQueryable <SceneSegment>)ExpandOperator.ExpandRelatedEntities <SceneSegment>(result); var sceneSegment = result.FirstOrDefault(); var sceneSegmentSearch = SceneSegmentOperator.SetSceneSegmentSearchModelCascade(sceneSegment); return(sceneSegmentSearch); }
public IEnumerable <SceneSegmentSearchModel> GetAll() { var queryData = from S in _context.SceneSegments select S; var result = QueryOperate <SceneSegment> .Execute(queryData); result = (IQueryable <SceneSegment>)ExpandOperator.ExpandRelatedEntities <SceneSegment>(result); //以下执行完后才会去数据库中查询 var sceneSegments = result.ToList(); var sceneSegmentsSearch = SceneSegmentOperator.SetSceneSegmentSearchModelCascade(sceneSegments); return(sceneSegmentsSearch); }