Пример #1
0
        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);
        }
Пример #2
0
        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);
        }
Пример #3
0
        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);
        }