/// <summary>
 ///     This is an internal API that supports the Entity Framework Core infrastructure and not subject to
 ///     the same compatibility standards as public APIs. It may be changed or removed without notice in
 ///     any release. You should only use it directly in your code with extreme caution and knowing that
 ///     doing so can result in application failures when updating to a new Entity Framework Core release.
 /// </summary>
 public virtual ParameterBinding Bind(
     IReadOnlyEntityType entityType,
     Type parameterType,
     string parameterName)
 => new ContextParameterBinding(
     parameterType,
     entityType.GetServiceProperties().Cast <IPropertyBase>().Where(p => p.ClrType == parameterType).ToArray());
 public virtual ParameterBinding Bind(
     IReadOnlyEntityType entityType,
     Type parameterType,
     string parameterName)
 => new ContextParameterBinding(
     parameterType,
     (IPropertyBase?)entityType.GetServiceProperties().FirstOrDefault(p => p.ClrType == parameterType));
예제 #3
0
 /// <summary>
 ///     Creates a <see cref="ParameterBinding" /> for the given type and name on the given entity type.
 /// </summary>
 /// <param name="entityType">The entity type.</param>
 /// <param name="parameterType">The parameter type.</param>
 /// <param name="parameterName">The parameter name.</param>
 /// <returns>The binding.</returns>
 public virtual ParameterBinding Bind(
     IReadOnlyEntityType entityType,
     Type parameterType,
     string parameterName)
 => new DependencyInjectionParameterBinding(
     _serviceType,
     _serviceType,
     entityType.GetServiceProperties().Cast <IPropertyBase>().Where(p => p.ClrType == _serviceType).ToArray());
        /// <summary>
        ///     Creates a <see cref="ParameterBinding" /> for the given type and name on the given entity type.
        /// </summary>
        /// <param name="entityType">The entity type.</param>
        /// <param name="parameterType">The parameter type.</param>
        /// <param name="parameterName">The parameter name.</param>
        /// <returns>The binding.</returns>
        public virtual ParameterBinding Bind(
            IReadOnlyEntityType entityType,
            Type parameterType,
            string parameterName)
        {
            Check.NotNull(entityType, nameof(entityType));
            Check.NotNull(parameterType, nameof(parameterType));
            Check.NotEmpty(parameterName, nameof(parameterName));

            return(new DependencyInjectionParameterBinding(
                       _serviceType,
                       _serviceType,
                       entityType.GetServiceProperties().Cast <IPropertyBase>().Where(p => p.ClrType == _serviceType).ToArray()));
        }
        public virtual ParameterBinding Bind(
            IReadOnlyEntityType entityType,
            Type parameterType,
            string parameterName)
        {
            Check.NotNull(entityType, nameof(entityType));
            Check.NotNull(parameterType, nameof(parameterType));
            Check.NotEmpty(parameterName, nameof(parameterName));

            return(new DependencyInjectionParameterBinding(
                       _serviceType,
                       _serviceType,
                       (IPropertyBase?)entityType.GetServiceProperties().FirstOrDefault(p => p.ClrType == _serviceType)));
        }