コード例 #1
0
        /// <summary>
        ///     Clones this dependency parameter object with one service replaced.
        /// </summary>
        /// <param name="methodCallTranslator"> A replacement for the current dependency of this type. </param>
        /// <returns> A new parameter object with the given service replaced. </returns>
        public SqlTranslatingExpressionVisitorDependencies With([NotNull] ICompositeMethodCallTranslator methodCallTranslator)
        => new SqlTranslatingExpressionVisitorDependencies(
            CompositeExpressionFragmentTranslator,
            methodCallTranslator,
            MemberTranslator,
#pragma warning disable 618
            RelationalTypeMapper,
#pragma warning restore 618
            TypeMappingSource);
コード例 #2
0
        public SqliteExCompositeMethodCallTranslator(
            ICompositeMethodCallTranslator compositeMethodCallTranslator,
            RelationalCompositeMethodCallTranslatorDependencies dependencies)
            : base(dependencies)
        {
            _compositeMethodCallTranslator = compositeMethodCallTranslator;

            AddTranslators(
                new[]
            {
                new SqliteTimeSpanMethodTranslator()
            });
        }
        /// <summary>
        ///     <para>
        ///         Creates the service dependencies parameter object for a <see cref="SqlTranslatingExpressionVisitor" />.
        ///     </para>
        ///     <para>
        ///         This API supports the Entity Framework Core infrastructure and is not intended to be used
        ///         directly from your code. This API may change or be removed in future releases.
        ///     </para>
        ///     <para>
        ///         Do not call this constructor directly from either provider or application code as it may change
        ///         as new dependencies are added. Instead, use this type in your constructor so that an instance
        ///         will be created and injected automatically by the dependency injection container. To create
        ///         an instance with some dependent services replaced, first resolve the object from the dependency
        ///         injection container, then replace selected services using the 'With...' methods. Do not call
        ///         the constructor at any point in this process.
        ///     </para>
        /// </summary>
        /// <param name="compositeExpressionFragmentTranslator"> The composite expression fragment translator. </param>
        /// <param name="methodCallTranslator"> The method call translator. </param>
        /// <param name="memberTranslator"> The member translator. </param>
        /// <param name="typeMappingSource"> The type mapper. </param>
        public SqlTranslatingExpressionVisitorDependencies(
            [NotNull] IExpressionFragmentTranslator compositeExpressionFragmentTranslator,
            [NotNull] ICompositeMethodCallTranslator methodCallTranslator,
            [NotNull] IMemberTranslator memberTranslator,
            [NotNull] IRelationalTypeMappingSource typeMappingSource)
        {
            Check.NotNull(compositeExpressionFragmentTranslator, nameof(compositeExpressionFragmentTranslator));
            Check.NotNull(methodCallTranslator, nameof(methodCallTranslator));
            Check.NotNull(memberTranslator, nameof(memberTranslator));
            Check.NotNull(typeMappingSource, nameof(typeMappingSource));

            CompositeExpressionFragmentTranslator = compositeExpressionFragmentTranslator;
            MethodCallTranslator = methodCallTranslator;
            MemberTranslator     = memberTranslator;
            TypeMappingSource    = typeMappingSource;
        }
コード例 #4
0
        /// <summary>
        ///     <para>
        ///         Creates the service dependencies parameter object for a <see cref="SqlTranslatingExpressionVisitor" />.
        ///     </para>
        ///     <para>
        ///         This API supports the Entity Framework Core infrastructure and is not intended to be used
        ///         directly from your code. This API may change or be removed in future releases.
        ///     </para>
        ///     <para>
        ///         Do not call this constructor directly from either provider or application code as it may change
        ///         as new dependencies are added. Instead, use this type in your constructor so that an instance
        ///         will be created and injected automatically by the dependency injection container. To create
        ///         an instance with some dependent services replaced, first resolve the object from the dependency
        ///         injection container, then replace selected services using the 'With...' methods. Do not call
        ///         the constructor at any point in this process.
        ///     </para>
        /// </summary>
        /// <param name="compositeExpressionFragmentTranslator"> The composite expression fragment translator. </param>
        /// <param name="methodCallTranslator"> The method call translator. </param>
        /// <param name="memberTranslator"> The member translator. </param>
        /// <param name="relationalTypeMapper"> The relational type mapper. </param>
        public SqlTranslatingExpressionVisitorDependencies(
            [NotNull] IExpressionFragmentTranslator compositeExpressionFragmentTranslator,
            [NotNull] ICompositeMethodCallTranslator methodCallTranslator,
            [NotNull] IMemberTranslator memberTranslator,
            [NotNull] IRelationalTypeMapper relationalTypeMapper)
        {
            Check.NotNull(compositeExpressionFragmentTranslator, nameof(compositeExpressionFragmentTranslator));
            Check.NotNull(methodCallTranslator, nameof(methodCallTranslator));
            Check.NotNull(memberTranslator, nameof(memberTranslator));
            Check.NotNull(relationalTypeMapper, nameof(relationalTypeMapper));

            CompositeExpressionFragmentTranslator = compositeExpressionFragmentTranslator;
            MethodCallTranslator = methodCallTranslator;
            MemberTranslator     = memberTranslator;
            RelationalTypeMapper = relationalTypeMapper;
        }
コード例 #5
0
        /// <summary>
        ///     Creates a new instance of <see cref="SqlTranslatingExpressionVisitor" />.
        /// </summary>
        /// <param name="dependencies"> Parameter object containing dependencies for this service. </param>
        /// <param name="queryModelVisitor"> The query model visitor. </param>
        /// <param name="targetSelectExpression"> The target select expression. </param>
        /// <param name="topLevelPredicate"> The top level predicate. </param>
        /// <param name="inProjection"> true if the expression to be translated is a LINQ projection. </param>
        public SqlTranslatingExpressionVisitor(
            [NotNull] SqlTranslatingExpressionVisitorDependencies dependencies,
            [NotNull] RelationalQueryModelVisitor queryModelVisitor,
            [CanBeNull] SelectExpression targetSelectExpression = null,
            [CanBeNull] Expression topLevelPredicate            = null,
            bool inProjection = false)
        {
            Check.NotNull(dependencies, nameof(dependencies));
            Check.NotNull(queryModelVisitor, nameof(queryModelVisitor));

            _compositeExpressionFragmentTranslator = dependencies.CompositeExpressionFragmentTranslator;
            _methodCallTranslator           = dependencies.MethodCallTranslator;
            _memberTranslator               = dependencies.MemberTranslator;
            _typeMappingSource              = dependencies.TypeMappingSource;
            _queryModelVisitor              = queryModelVisitor;
            _targetSelectExpression         = targetSelectExpression;
            _topLevelPredicate              = topLevelPredicate;
            _inProjection                   = inProjection;
            _nullCheckRemovalTestingVisitor = new NullCheckRemovalTestingVisitor(_queryModelVisitor);
            _isTopLevelProjection           = inProjection;
        }
コード例 #6
0
        /// <summary>
        ///     <para>
        ///         Creates the service dependencies parameter object for a <see cref="SqlTranslatingExpressionVisitor" />.
        ///     </para>
        ///     <para>
        ///         This API supports the Entity Framework Core infrastructure and is not intended to be used
        ///         directly from your code. This API may change or be removed in future releases.
        ///     </para>
        ///     <para>
        ///         Do not call this constructor directly from either provider or application code as it may change
        ///         as new dependencies are added. Instead, use this type in your constructor so that an instance
        ///         will be created and injected automatically by the dependency injection container. To create
        ///         an instance with some dependent services replaced, first resolve the object from the dependency
        ///         injection container, then replace selected services using the 'With...' methods. Do not call
        ///         the constructor at any point in this process.
        ///     </para>
        /// </summary>
        /// <param name="compositeExpressionFragmentTranslator"> The composite expression fragment translator. </param>
        /// <param name="methodCallTranslator"> The method call translator. </param>
        /// <param name="memberTranslator"> The member translator. </param>
        /// <param name="relationalTypeMapper"> The relational type mapper. </param>
        /// <param name="typeMappingSource"> The type mapper. </param>
        public SqlTranslatingExpressionVisitorDependencies(
            [NotNull] IExpressionFragmentTranslator compositeExpressionFragmentTranslator,
            [NotNull] ICompositeMethodCallTranslator methodCallTranslator,
            [NotNull] IMemberTranslator memberTranslator,
            [NotNull] IRelationalTypeMapper relationalTypeMapper,
            [NotNull] IRelationalTypeMappingSource typeMappingSource)
        {
            Check.NotNull(compositeExpressionFragmentTranslator, nameof(compositeExpressionFragmentTranslator));
            Check.NotNull(methodCallTranslator, nameof(methodCallTranslator));
            Check.NotNull(memberTranslator, nameof(memberTranslator));
            Check.NotNull(relationalTypeMapper, nameof(relationalTypeMapper));
            Check.NotNull(typeMappingSource, nameof(typeMappingSource));

            CompositeExpressionFragmentTranslator = compositeExpressionFragmentTranslator;
            MethodCallTranslator = methodCallTranslator;
            MemberTranslator     = memberTranslator;
#pragma warning disable 618
            RelationalTypeMapper = relationalTypeMapper;
#pragma warning restore 618
            TypeMappingSource = typeMappingSource;
        }
 /// <summary>
 ///     Clones this dependency parameter object with one service replaced.
 /// </summary>
 /// <param name="methodCallTranslator"> A replacement for the current dependency of this type. </param>
 /// <returns> A new parameter object with the given service replaced. </returns>
 public SqlTranslatingExpressionVisitorDependencies With([NotNull] ICompositeMethodCallTranslator methodCallTranslator)
 => new SqlTranslatingExpressionVisitorDependencies(
     CompositeExpressionFragmentTranslator,
     methodCallTranslator,
     MemberTranslator,
     TypeMappingSource);