Пример #1
0
        private InjectChunk TransformChunk(InjectChunk injectChunk)
        {
            var typeName = ChunkHelper.ReplaceTModel(injectChunk.TypeName, _modelType);

            if (typeName != injectChunk.TypeName)
            {
                return(new InjectChunk(typeName, injectChunk.MemberName)
                {
                    Start = injectChunk.Start,
                    Association = injectChunk.Association
                });
            }
            return(injectChunk);
        }
Пример #2
0
        private SetBaseTypeChunk TransformChunk(SetBaseTypeChunk setBaseTypeChunk)
        {
            var typeName = ChunkHelper.ReplaceTModel(setBaseTypeChunk.TypeName, _modelType);

            if (typeName != setBaseTypeChunk.TypeName)
            {
                return(new SetBaseTypeChunk
                {
                    TypeName = typeName,
                    Start = setBaseTypeChunk.Start,
                    Association = setBaseTypeChunk.Association
                });
            }
            return(setBaseTypeChunk);
        }
Пример #3
0
        /// <inheritdoc />
        public void VisitChunk(Chunk chunk)
        {
            if (chunk == null)
            {
                throw new ArgumentNullException(nameof(chunk));
            }

            var injectChunk = chunk as InjectChunk;

            if (injectChunk != null)
            {
                injectChunk.TypeName = ChunkHelper.ReplaceTModel(injectChunk.TypeName, _modelType);
                _addedMemberNames.Add(injectChunk.MemberName);
            }
        }
Пример #4
0
        /// <inheritdoc />
        public void VisitChunk(Chunk chunk)
        {
            if (chunk == null)
            {
                throw new ArgumentNullException(nameof(chunk));
            }

            var setBaseTypeChunk = chunk as SetBaseTypeChunk;

            if (setBaseTypeChunk != null)
            {
                setBaseTypeChunk.TypeName = ChunkHelper.ReplaceTModel(setBaseTypeChunk.TypeName, _modelType);
                _isBaseTypeSet            = true;
            }
        }