public override IServiceDefinitionCollection RegisterServices(IServiceDefinitionCollection serviceCollection)
        {
            serviceCollection.AddTransient <IDevJokeRepository, DevJokeRepository>();

            serviceCollection.AddTransient <IDevJokeService, DevJokeService>();

            return(serviceCollection);
        }
Exemple #2
0
        public override IServiceDefinitionCollection RegisterServices(IServiceDefinitionCollection serviceCollection)
        {
            serviceCollection.AddTransient <IDevJokeRepository, DevJokeRepository>();
            serviceCollection.AddTransient <ICategoryRepository, CategoryRepository>();

            serviceCollection.AddDefaultDetachedEntityMapper <Category>();
            serviceCollection.AddDefaultDetachedEntityMapper <DevJoke>();
            serviceCollection.AddSingleton <IDetachedEntityMapperFactory, DetachedEntityMapperFactory>();

            serviceCollection.AddDefaultEntityMapper <Category, CategoryDto, int>(c => c.Id, c => c.Id);
            serviceCollection.AddEntityMapper <DevJoke, DevJokeDto, DevJokeMappingDtoMapperConfiguration, int>(d => d.Id, d => d.Id);

            serviceCollection.AddTransient <IDevJokeService, DevJokeService>();
            serviceCollection.AddTransient <ICategoryService, CategoryService>();

            serviceCollection.AddMapperFactories();

            return(serviceCollection);
        }
        public override IServiceDefinitionCollection RegisterServices(IServiceDefinitionCollection serviceCollection)
        {
            base.RegisterServices(serviceCollection);
            serviceCollection.AddTransient <IRelationalEntityConfiguration, DevJokeConfiguration>();
            serviceCollection.AddTransient <IRelationalEntityConfiguration, CategoryConfiguration>();

            serviceCollection.AddTransient <DevFunStorage>();
            serviceCollection.AddTransient <IStorage, DevFunStorage>();
            serviceCollection.AddTransient <StorageSession <DevFunStorage> >();
            serviceCollection.AddTransient <IStorageFactory <IStorage>, StorageFactory <DevFunStorage> >();
            serviceCollection.AddTransient <IStorageFactory <IDevFunStorage>, StorageFactory <DevFunStorage> >();
            serviceCollection.AddTransient <IStorageFactory <DevFunStorage>, StorageFactory <DevFunStorage> >();

            return(serviceCollection);
        }
 public override IServiceDefinitionCollection RegisterServices(IServiceDefinitionCollection serviceCollection)
 {
     serviceCollection.AddTransient <IDataInitializer, TestDataInitializer>();
     return(serviceCollection);
 }