/// <summary> /// Provides dependencies for ICommandMultipleResultExpressions. /// </summary> /// <param name="propertyMetadataExtractor">The property metadata extractor.</param> /// <param name="multipleResultSetCommandProcessorFactory">The multiple result set command processor factory.</param> public CommandMultipleResultExpressionFactory( IPropertyMetadataExtractor propertyMetadataExtractor, IMultipleResultSetCommandProcessorFactory multipleResultSetCommandProcessorFactory) { _propertyMetadataExtractor = propertyMetadataExtractor; _multipleResultSetCommandProcessorFactory = multipleResultSetCommandProcessorFactory; }
/// <summary> /// Provides dependencies for ICommandMultipleResultExpressions. /// </summary> /// <param name="propertyMetadataExtractor">The property metadata extractor.</param> /// <param name="singleResultSetCommandProcessorFactory">The single result set command processor factory.</param> public CommandSingleResultExpressionFactory( IPropertyMetadataExtractor propertyMetadataExtractor, ISingleResultSetCommandProcessorFactory singleResultSetCommandProcessorFactory) { _propertyMetadataExtractor = propertyMetadataExtractor; _singleResultSetCommandProcessorFactory = singleResultSetCommandProcessorFactory; }
/// <summary> /// Initializes a new instance of the <see cref="CommandExpressionFactory" /> class. /// </summary> /// <param name="propertyMetadataExtractor">The property metadata extractor.</param> /// <param name="noResultSetCommandProcessorFactory">The no result set command processor factory.</param> /// <param name="commandMultipleResultExpressionFactory">The command multiple result expression factory.</param> /// <param name="commandSingleResultExpressionFactory">The command single result expression factory.</param> /// <exception cref="System.ArgumentNullException"> /// </exception> public CommandExpressionFactory( IPropertyMetadataExtractor propertyMetadataExtractor, INoResultSetCommandProcessorFactory noResultSetCommandProcessorFactory, ICommandMultipleResultExpressionFactory commandMultipleResultExpressionFactory, ICommandSingleResultExpressionFactory commandSingleResultExpressionFactory) { if (propertyMetadataExtractor == null) { throw new ArgumentNullException(nameof(propertyMetadataExtractor)); } if (noResultSetCommandProcessorFactory == null) { throw new ArgumentNullException(nameof(noResultSetCommandProcessorFactory)); } if (commandMultipleResultExpressionFactory == null) { throw new ArgumentNullException(nameof(commandMultipleResultExpressionFactory)); } if (commandSingleResultExpressionFactory == null) { throw new ArgumentNullException(nameof(commandSingleResultExpressionFactory)); } _propertyMetadataExtractor = propertyMetadataExtractor; _noResultSetCommandProcessorFactory = noResultSetCommandProcessorFactory; _commandMultipleResultExpressionFactory = commandMultipleResultExpressionFactory; _commandSingleResultExpressionFactory = commandSingleResultExpressionFactory; }
/// <summary> /// Initializes a new instance of the <see cref="CommandExpression{TFilter}" /> class. /// </summary> /// <param name="propertyMetadataExtractor">A property metadata extractor.</param> /// <param name="noResultSetCommandProcessorFactory">A no result set command processor factory.</param> /// <param name="commandMultipleResultExpressionFactory">The command multiple result expression factory.</param> /// <param name="commandSingleResultExpressionFactory">The command single result expression factory.</param> /// <param name="commandText">The CommandBuilder text.</param> /// <param name="commandType">Type of the CommandBuilder.</param> /// <exception cref="System.ArgumentNullException">databaseManager /// or /// commandText</exception> /// <exception cref="System.ArgumentException">No CommandBuilder text provided.;commandText /// or /// TableDirect is not supported.;commandType</exception> public CommandExpression(IPropertyMetadataExtractor propertyMetadataExtractor, INoResultSetCommandProcessorFactory noResultSetCommandProcessorFactory, ICommandMultipleResultExpressionFactory commandMultipleResultExpressionFactory, ICommandSingleResultExpressionFactory commandSingleResultExpressionFactory, string commandText, CommandType commandType) { if (propertyMetadataExtractor == null) { throw new ArgumentNullException(nameof(propertyMetadataExtractor)); } if (noResultSetCommandProcessorFactory == null) { throw new ArgumentNullException(nameof(noResultSetCommandProcessorFactory)); } if (commandText == null) { throw new ArgumentNullException(nameof(commandText)); } if (string.IsNullOrWhiteSpace(commandText)) { throw new ArgumentException("No CommandBuilder text provided.", nameof(commandText)); } if (commandType == CommandType.TableDirect) { throw new ArgumentException("TableDirect is not supported.", nameof(commandType)); } _propertyMetadataExtractor = propertyMetadataExtractor; _noResultSetCommandProcessorFactory = noResultSetCommandProcessorFactory; _commandMultipleResultExpressionFactory = commandMultipleResultExpressionFactory; _commandSingleResultExpressionFactory = commandSingleResultExpressionFactory; CommandText = commandText; DbCommandType = commandType; }
/// <summary> /// Initializes a new instance of the <see cref="CommandSingleResultExpression{TFilter,TResult}" /> class. /// </summary> /// <param name="propertyMetadataExtractor">The property metadata extractor.</param> /// <param name="singleResultSetCommandProcessorFactory">The single result set command processor factory.</param> /// <param name="command">The CommandBuilder.</param> public CommandSingleResultExpression( IPropertyMetadataExtractor propertyMetadataExtractor, ISingleResultSetCommandProcessorFactory singleResultSetCommandProcessorFactory, ICommandBuilderInfo <TFilter> command) : base(propertyMetadataExtractor, command) { _singleResultSetCommandProcessorFactory = singleResultSetCommandProcessorFactory; }
/// <summary> /// Initializes a new instance of the <see cref="CommandMultipleResultExpression{TFilter}" /> class. /// </summary> /// <param name="propertyMetadataExtractor">The property metadata extractor.</param> /// <param name="multipleResultSetCommandProcessorFactory">The multiple result set command processor factory.</param> /// <param name="command">The CommandBuilder.</param> /// <param name="resultTypes">The result types.</param> /// <exception cref="System.ArgumentNullException"></exception> /// <exception cref="ArgumentNullException"></exception> public CommandMultipleResultExpression( IPropertyMetadataExtractor propertyMetadataExtractor, IMultipleResultSetCommandProcessorFactory multipleResultSetCommandProcessorFactory, ICommandBuilderInfo <TFilter> command, params Type[] resultTypes) : base(propertyMetadataExtractor, command) { if (multipleResultSetCommandProcessorFactory == null) { throw new ArgumentNullException(nameof(multipleResultSetCommandProcessorFactory)); } _multipleResultSetCommandProcessorFactory = multipleResultSetCommandProcessorFactory; _resultTypes = resultTypes; }
/// <summary> /// Initializes a new instance of the <see cref="DefaultResultMapping" /> class. /// </summary> /// <param name="propertyMetadataExtractor">The property metadata extractor.</param> /// <param name="resultType">Type of the result.</param> /// <param name="actions">The actions.</param> public DefaultResultMapping(IPropertyMetadataExtractor propertyMetadataExtractor, Type resultType, DescriptorActions actions = DescriptorActions.Read) { _propertyMetadataExtractor = propertyMetadataExtractor; _resultType = resultType; _actions = actions; }
/// <summary> /// Resolves dependencies for Result mapping expressions and instantiates. /// </summary> /// <param name="propertyMetadataExtractor">The property metadata extractor.</param> public ResultMappingExpression(IPropertyMetadataExtractor propertyMetadataExtractor) { _propertyMetadataExtractor = propertyMetadataExtractor; MapDeclarativeProperties(); }
/// <summary> /// Initializes a new instance of the <see cref="CommandResultMappingStorage{TFilter}" /> class. /// </summary> /// <param name="propertyMetadataExtractor">The property metadata extractor.</param> public CommandResultMappingStorage(IPropertyMetadataExtractor propertyMetadataExtractor) { _propertyMetadataExtractor = propertyMetadataExtractor; _mappingContainer = new Dictionary <Type, IMappingExport>(); _mappingContainerRuntime = new Dictionary <Type, IMappingExport>(); }
/// <summary> /// Initializes a new instance of the <see cref="CommandResultExpression{TFilter}" /> class. /// </summary> /// <param name="propertyMetadataExtractor">The property metadata extractor.</param> /// <param name="command">The CommandBuilder.</param> protected CommandResultExpression(IPropertyMetadataExtractor propertyMetadataExtractor, ICommandBuilderInfo <TFilter> command) : this(command, new CommandResultMappingStorage <TFilter>(propertyMetadataExtractor)) { }