public CsvHelperReader(IServiceProvider?serviceProvider) { _serviceProvider = serviceProvider; }
/// <summary> /// Retrieves an instance of <see cref="ILogger"/> given the type name <typeparamref name="T"/>. /// This is equivalent to <see cref="LoggerFactoryExtensions.CreateLogger{T}(ILoggerFactory)"/>. /// </summary> /// <returns> /// An <see cref="ILogger"/> instance, or null if <paramref name="services"/> is null or the /// <see cref="IServiceProvider"/> cannot produce an <see cref="ILoggerFactory"/>. /// </returns> public static ILogger GetLogger <T>(this IServiceProvider?services) { return(GetLogger(services, typeof(T))); }
public OeBatchParser(Uri baseUri, IEdmModel edmModel, IServiceProvider?serviceProvider = null) { _baseUri = baseUri; _edmModel = edmModel; _serviceProvider = serviceProvider; }
protected TriggeredDbContext(IServiceProvider?serviceProvider) : this(new DbContextOptions <DbContext>(), serviceProvider) { }
public void SetTriggerServiceProvider(IServiceProvider?serviceProvider) => _triggerServiceProvider = serviceProvider;
internal PageConventionCollection(IServiceProvider?serviceProvider) { _serviceProvider = serviceProvider; }
public LibraryViewModel(IServiceProvider?serviceProvider) : base(serviceProvider) { }
internal virtual Task HandleMessage(IServiceProvider?provider, byte[] message) { return(Task.CompletedTask); }
public ImageShapeViewModel(IServiceProvider?serviceProvider) : base(serviceProvider, typeof(ImageShapeViewModel)) { }
public ArgbColorViewModel(IServiceProvider?serviceProvider) : base(serviceProvider) { }
public CopyGitLinkPackage() { ServiceProvider = this; }
public UsingValueServiceProvider(IServiceProvider provider) { this._Provider = provider ?? throw new ArgumentNullException(nameof(provider)); this.CurrentState = State.Init; this._Value = default; }
public ShapeFactory(IServiceProvider?serviceProvider) { _serviceProvider = serviceProvider; }
public static async Task SerializeAsync(OeQueryContext queryContext, IAsyncEnumerator <Object?> asyncEnumerator, String contentType, Stream stream, OeEntryFactory entryFactory, IServiceProvider?serviceProvider, CancellationToken cancellationToken) { var settings = new ODataMessageWriterSettings() { BaseUri = queryContext.ODataUri.ServiceRoot, EnableMessageStreamDisposal = false, ODataUri = queryContext.ODataUri, Validations = ValidationKinds.ThrowOnDuplicatePropertyNames, Version = ODataVersion.V4 }; if (serviceProvider != null) { serviceProvider = new ServiceProvider(serviceProvider, settings); } IODataResponseMessage responseMessage = new Infrastructure.OeInMemoryMessage(stream, contentType, serviceProvider); using (ODataMessageWriter messageWriter = new ODataMessageWriter(responseMessage, settings, queryContext.EdmModel)) { ODataUtils.SetHeadersForPayload(messageWriter, ODataPayloadKind.ResourceSet); ODataWriter writer = await messageWriter.CreateODataResourceSetWriterAsync(entryFactory.EntitySet, entryFactory.EdmEntityType); var odataWriter = new OeODataWriter(queryContext, writer, cancellationToken); await odataWriter.WriteAsync(entryFactory, asyncEnumerator).ConfigureAwait(false); } }
public PngSkiaSharpWriter(IServiceProvider?serviceProvider) { _serviceProvider = serviceProvider; }
public NotificationBuilder(IToastOptions options, INotificationReceiver notificationReceiver, IPermission permission, IServiceProvider?serviceProvider) { this.options = options; this.notificationReceiver = notificationReceiver; this.permission = permission; this.serviceProvider = serviceProvider; this.Notification = new UNMutableNotificationContent(); this.attachments = new List <UNNotificationAttachment>(); if (options.Sound != null) { Notification.Sound = options.Sound; } this.UseConfigurationFrom <IIosNotificationExtension>(serviceProvider); this.UseConfigurationFrom <IPlatformSpecificExtension>(serviceProvider); }
/// <summary> /// Creates a new instance of an <see cref="EncryptedXmlDecryptor"/>. /// </summary> /// <param name="services">An optional <see cref="IServiceProvider"/> to provide ancillary services.</param> public EncryptedXmlDecryptor(IServiceProvider?services) { _decryptor = services?.GetService <IInternalEncryptedXmlDecryptor>() ?? this; _options = services?.GetService <IOptions <XmlKeyDecryptionOptions> >()?.Value; }
private T ResolveService <T>(IServiceProvider?serviceProvider, T defaultValue) { return((T?)serviceProvider?.GetService(typeof(T)) ?? defaultValue); }
public static void Initialize(IAzureFunctionsApi azureFunctionsApi, IGitHubApiV3 gitHubApiV3, IGitHubGraphQLApi gitHubGraphQLApi) => _serviceProviderHolder = CreateContainer(azureFunctionsApi, gitHubApiV3, gitHubGraphQLApi);
public ArcShapeViewModel(IServiceProvider?serviceProvider) : base(serviceProvider, typeof(ArcShapeViewModel)) { }
public LineToolViewModel(IServiceProvider?serviceProvider) : base(serviceProvider) { }
/// <summary> /// Creates a new instance of a <see cref="DpapiXmlDecryptor"/>. /// </summary> /// <param name="services">An optional <see cref="IServiceProvider"/> to provide ancillary services.</param> public DpapiXmlDecryptor(IServiceProvider?services) { CryptoUtil.AssertPlatformIsWindows(); _logger = services.GetLogger <DpapiXmlDecryptor>(); }
protected TriggeredDbContext(DbContextOptions options, IServiceProvider?serviceProvider) : base(options) { _triggerServiceProvider = serviceProvider; }
public static TServiceTypeBase GetService <TServiceTypeBase>(this IServiceProvider?serviceProvider, Type serviceType) where TServiceTypeBase : class => serviceProvider?.GetService(serviceType) as TServiceTypeBase;
/// <summary> /// Sets the <see cref="IServiceProvider" /> from which application services will be obtained. This /// is done automatically when using 'AddDbContext', so it is rare that this method needs to be called. /// </summary> /// <param name="serviceProvider"> The service provider to be used. </param> /// <returns> The same builder instance so that multiple calls can be chained. </returns> public new virtual DbContextOptionsBuilder <TContext> UseApplicationServiceProvider(IServiceProvider?serviceProvider) => (DbContextOptionsBuilder <TContext>)base.UseApplicationServiceProvider(serviceProvider);
/// <summary> /// Initializes a new instance of the <see cref='EventsTab'/> class. /// </summary> public EventsTab(IServiceProvider?sp) => _serviceProvider = sp;
/// <summary> /// Retrieves an instance of <see cref="ILogger"/> given the type name <paramref name="type"/>. /// This is equivalent to <see cref="LoggerFactoryExtensions.CreateLogger{T}(ILoggerFactory)"/>. /// </summary> /// <returns> /// An <see cref="ILogger"/> instance, or null if <paramref name="services"/> is null or the /// <see cref="IServiceProvider"/> cannot produce an <see cref="ILoggerFactory"/>. /// </returns> public static ILogger GetLogger(this IServiceProvider?services, Type type) { // Compiler won't allow us to use static types as the type parameter // for the call to CreateLogger<T>, so we'll duplicate its logic here. return(services?.GetService <ILoggerFactory>()?.CreateLogger(type.FullName !) ?? NullLogger.Instance); }
public SkiaSharpRendererViewModel(IServiceProvider?serviceProvider) : base(serviceProvider, new SkiaSharpDrawNodeFactory()) { }
public OeParser(Uri baseUri, IEdmModel edmModel, Query.OeModelBoundProvider?modelBoundProvider, IServiceProvider?serviceProvider = null) { BaseUri = baseUri; EdmModel = edmModel; ModelBoundProvider = modelBoundProvider; _serviceProvider = serviceProvider; }
public void InitializeServiceProperties() { this.serviceProvider = ContainerBindings.GetServiceProvider(this.scenarioContext); this.tenantStore = this.serviceProvider.GetRequiredService <ITenantStore>(); }