Beispiel #1
0
        private static IUnitRepository CreateRepository()
        {
            var customerId = 125134;

            var factory = new PersonalLegacyContextFactoryBuilder()
                          //.SetConnectionstringFormat("Data source=\.;Initial Catalog=SticosPersonalKunde_{0};User ID=sa;Password=xxx!")
                          .WithCurrentCustomerId(customerId)
                          .Build();

            var repository = new UnitCompanyLegacyDbEfRepositoryBuilder()
                             .WithMapper(AutoMapperSetup.Config.CreateMapper())
                             .WithDbFactory(factory)
                             .Build();

            return(repository);
        }
Beispiel #2
0
        private static IUnitService CreateUnitService()
        {
            var customerId = 1;

            var factory = new PersonalLegacyContextFactoryBuilder()
                          .SetConnectionstringFormat("Data Source=.;Initial Catalog=SticosPersonalKunde_{0};Integrated Security=True;")
                          .WithCurrentCustomerId(customerId)
                          .Build();

            var repository = new UnitCompanyLegacyDbEfRepositoryBuilder()
                             .WithMapper(AutoMapperSetup.Config.CreateMapper())
                             .WithDbFactory(factory)
                             .Build();

            var controller = new UnitServiceBuilder()
                             .WithCompanyRepository(repository)
                             .Build();

            return(controller);
        }