This project is read-only.
Note: The following are typically injected: IRepositoryProvider, IDataContextAsync, IDataContextAsync, IRepository, IRepositoryAsync vs. manually instantiated as they are in the code samples below.


private readonly IRepositoryProvider _repositoryProvider = new RepositoryProvider(new RepositoryFactories());

using (IDataContextAsync context = new NorthwindContext())
using (IUnitOfWorkAsync unitOfWork = new UnitOfWork(context, _repositoryProvider))
{
    IRepositoryAsync<Customer> customerRepository = new Repository<Customer>(context, unitOfWork);
    IService<Customer> customerService = new CustomerService(customerRepository);
    var customer = customerService.Find("ALFKI");
    TestContext.WriteLine("Customers found: {0}", customer.ContactName);
    Assert.AreEqual(customer.ContactName, "Maria Anders");
}


Last edited Dec 1, 2014 at 12:50 AM by lelong37, version 2