This project is read-only.
Update (1/1/2014): This feature as been decommissioned in v3.3.5, leaving document here for support for those that are on <= v3.3.4.

Example (Unit Test) on How to Add Custom Repositories

This allows you to access all Repositories in your application the same way, so that it's consistent for all Repositories not just for database (EF) ones.

Full source code

public void GetCustomRepositoryFromOtherRepository()
    // Setup custom repositories e.g. IAzureBlobRepository
    var factories = new Dictionary<Type, Func<dynamic>>
            typeof (IAzureBlobRepository<MyBlob>),
            () => new AzureBlobRepository<MyBlob>()

    IRepositoryProvider repositoryProvider = 
        new RepositoryProvider(new RepositoryFactories(factories));

    using (IDataContextAsync context = new NorthwindFakeContext())
    using (IUnitOfWorkAsync uow = new UnitOfWork(context, repositoryProvider))
        IRepositoryAsync<Product> productRepository = 
            new Repository<Product>(context, uow);

        // Retrieving custom repository from UnitOfWork instance
        var blobRepository1 = 

        // Retrieving custom repository from another repository
        var blobRepository2 = 

        Assert.AreEqual(blobRepository1.SayHello(), "Hello World!");
        Assert.AreEqual(blobRepository2.SayHello(), "Hello World!");

Last edited Dec 31, 2014 at 7:44 PM by lelong37, version 40