Skip to content

Instantly share code, notes, and snippets.

@merken
Created January 6, 2020 14:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save merken/8936b00bb76fcae92402ae8fe8e44f88 to your computer and use it in GitHub Desktop.
Save merken/8936b00bb76fcae92402ae8fe8e44f88 to your computer and use it in GitHub Desktop.
using System;
using System.Data;
using System.Data.Common;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Prise.Plugin;
namespace TableStoragePlugin
{
[PluginBootstrapper(PluginType = typeof(TableStorageProductsRepository))]
public class TableStorageBootstrapper : IPluginBootstrapper
{
public IServiceCollection Bootstrap(IServiceCollection services)
{
var config = services.BuildServiceProvider().GetRequiredService<IConfiguration>();
var tableStorageConfig = new TableStorageConfig();
config.Bind("TableStoragePlugin", tableStorageConfig);
services.AddScoped<TableStorageConfig>((serviceProvider) =>
{
return tableStorageConfig;
});
return services;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment