Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
25 lines (22 sloc) 667 Bytes
using Lokad.Cqrs;
using Lokad.Cqrs.AtomicStorage;
using Recipes.Contracts;
using Recipes.Contracts.Projections;
using Recipes.Contracts.Providers;
namespace Recipes.ReadModel
{
public static class ProviderFactory
{
private static IAtomicContainer factory;
public static void SetFactory(IAtomicContainer providerFactory)
{
factory = providerFactory;
}
public static IRecipeProvider CreateRecipeProvider()
{
return new RecipeProvider(
factory.GetEntityReader<RecipeId, RecipeView>(),
factory.GetEntityReader<unit, RecipeByNameIndex>());
}
}
}