/// <summary> /// <para> /// Creates the service dependencies parameter object for a <see cref="Database" />. /// </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="queryCompilationContextFactory"> Factory for compilation contexts to process LINQ queries. </param> /// <param name="updateAdapterFactory"> Factory for creating model data tracker. </param> /// <param name="queryCompilationContextFactory2"> A </param> public DatabaseDependencies( [NotNull] IQueryCompilationContextFactory queryCompilationContextFactory, [NotNull] IUpdateAdapterFactory updateAdapterFactory, [NotNull] IQueryCompilationContextFactory2 queryCompilationContextFactory2) { Check.NotNull(queryCompilationContextFactory, nameof(queryCompilationContextFactory)); Check.NotNull(updateAdapterFactory, nameof(updateAdapterFactory)); QueryCompilationContextFactory = queryCompilationContextFactory; UpdateAdapterFactory = updateAdapterFactory; QueryCompilationContextFactory2 = queryCompilationContextFactory2; }
public DatabaseDependencies With([NotNull] IQueryCompilationContextFactory2 queryCompilationContextFactory2) => new DatabaseDependencies(QueryCompilationContextFactory, UpdateAdapterFactory, Check.NotNull(queryCompilationContextFactory2, nameof(queryCompilationContextFactory2)));