Skip to content

Instantly share code, notes, and snippets.

View merken's full-sized avatar

Maarten Merken merken

View GitHub Profile
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace Contract
{
/// <summary>
/// OldSQLPlugin only implements All() and Get(int productId).
/// SQLPlugin and TableStoragePlugin implement the contract described below.
///
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.AspNetCore.Http;
using Prise.AssemblyScanning;
using Prise.Infrastructure;
namespace Products.API.Infrastructure
{
public class TenantAssemblySelector<T> :
using Contract;
using Microsoft.EntityFrameworkCore;
using System;
namespace OldSQLPlugin
{
public class ProductsDbContext : DbContext
{
public virtual DbSet<Product> Products { get; set; }
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using OldSQLPlugin.Configuration;
using Prise.Plugin;
using System.Data.Common;
using System.Data.SqlClient;
namespace OldSQLPlugin
{
using System;
using System.IO;
using Contract;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Prise;
using Prise.AssemblyScanning.Discovery;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Contract;
using Microsoft.EntityFrameworkCore;
using Prise.Plugin;
namespace OldSQLPlugin
{
[Plugin(PluginType = typeof(IProductsRepository))]
namespace OldSQLPlugin.Configuration
{
public class SQLPluginConfig
{
public string ConnectionString { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using Contract;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.HttpsPolicy;
using Microsoft.AspNetCore.Mvc;
using System;
using System.IO;
using System.Linq;
using Microsoft.AspNetCore.Http;
using Prise.Infrastructure;
namespace Products.API.Infrastructure
{
public class TenantPluginProvider<T> :
IPluginPathProvider<T>,
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace Contract
{
public interface IProductsRepository
{
Task<IEnumerable<Product>> All();
Task<Product> Get(int productId);