public void Test_Facade()
        {
            var facade      = new RespositoryFactory();
            var latestRepo  = facade.GetLatestUploadedTorrents();
            var popularRepo = facade.GetMostPopularTorrents();

            Assert.IsTrue(latestRepo.MovieTorrents.Count() > 0);
            Assert.IsTrue(popularRepo.MovieTorrents.Count() > 0);
        }
        public static void Initialize(IServiceCollection services, IConfiguration configuration)
        {
            RespositoryFactory.Initialize(services, configuration);

            var scopedServices = Reflector.GetScopedList(typeof(ServiceFactory).Assembly).
                                 Where(w => w.Interface.Name.EndsWith("Service")).ToList();

            scopedServices.ForEach(item =>
            {
                services.AddScoped(item.Interface, item.Class);
            });
        }
Exemple #3
0
 protected IRespository <T> GetRespository <T>() where T : MEntity
 {
     return(RespositoryFactory.Create <T>());
 }