Exemplo n.º 1
0
 public DataInit(IPetRepository petRepository, IOwnerRepository ownerRepository, IPetTypeRepository petTypeRepository, IAuthenticationHelper authHelper)
 {
     _petRepository       = petRepository;
     _ownerRepository     = ownerRepository;
     _petTypeRepository   = petTypeRepository;
     authenticationHelper = authHelper;
 }
Exemplo n.º 2
0
 public PetService(IPetRepository petRepository, IOwnerRepository ownerRepository, IPetTypeRepository petTypeRepository, IPetColorRepository petColorRepository)
 {
     _petRepo      = petRepository;
     _ownerRepo    = ownerRepository;
     _petTypeRepo  = petTypeRepository;
     _petColorRepo = petColorRepository;
 }
Exemplo n.º 3
0
 public DataInitializer(IPetRepository petRepository,
                        IOwnerRepository ownerRepository,
                        IPetTypeRepository typeRepository)
 {
     _petRepo   = petRepository;
     _ownerRepo = ownerRepository;
     _typeRepo  = typeRepository;
 }
Exemplo n.º 4
0
 public InitStaticData(IPetRepository petRepository, IOwnerRepository ownerRepository, IPetTypeRepository petTypeRepository, IColorRepository colorRepository, IUserService userService)
 {
     this.PetRepository     = petRepository;
     this.OwnerRepository   = ownerRepository;
     this.PetTypeRepository = petTypeRepository;
     this.ColorRepository   = colorRepository;
     this.UserService       = userService;
 }
Exemplo n.º 5
0
 public InitData(IPetRepository petRepository, IOwnerRepository ownerRepository, IPetTypeRepository petTypeRepository)
 {
     _petRepository     = petRepository;
     _ownerRepository   = ownerRepository;
     _petTypeRepository = petTypeRepository;
     AddPets();
     AddOwners();
     AddPetTypes();
 }
 public DataInitializer(IPetRepository petRepository, IPetTypeRepository petTypeRepository, IOwnerRepository ownerRepository, IColorRepository colorRepository, IPetColorRepository petColorRepository, IUserRepository userRepository, IAuthenticationHelper authHelper)
 {
     _petRepository       = petRepository;
     _petTypeRepository   = petTypeRepository;
     _ownerRepository     = ownerRepository;
     _colorRepository     = colorRepository;
     _petColorRepository  = petColorRepository;
     _userRepository      = userRepository;
     authenticationHelper = authHelper;
 }
Exemplo n.º 7
0
        public PetRepository(IColourRepository colourService, IPetTypeRepository petTypeService, IPersonRepository personService)
        {
            _crep  = colourService;
            _ptrep = petTypeService;
            _prep  = personService;

            if (_nextId < 1)
            {
                _nextId = 1;
            }
            if (_pets == null)
            {
                _pets = new List <Pet>();
            }
        }
Exemplo n.º 8
0
 private void init(IServiceProvider serviceProvider)
 {
     IPetRepository     petRepository     = (IPetRepository)serviceProvider.GetService(typeof(IPetRepository));
     IPetTypeRepository petTypeRepository = (IPetTypeRepository)serviceProvider.GetService(typeof(IPetTypeRepository));
     IOwnerRepository   ownerRepository   = (IOwnerRepository)serviceProvider.GetService(typeof(IOwnerRepository));
 }
Exemplo n.º 9
0
 public PetTypeService(IPetTypeRepository typeRepository, IPetRepository petRepository)
 {
     _typeRepo = typeRepository;
     _petRepo  = petRepository;
 }
Exemplo n.º 10
0
 public PetTypeService(IPetTypeRepository petTypeRepository, IParser parser)
 {
     _petTypeRepository = petTypeRepository;
     _parser            = parser;
 }
Exemplo n.º 11
0
 public DataInit(IPetRepository petRepository, IOwnerRepository ownerRepository, IPetTypeRepository petTypeRepository)
 {
     _petRepository     = petRepository;
     _ownerRepository   = ownerRepository;
     _petTypeRepository = petTypeRepository;
 }
Exemplo n.º 12
0
 public PetService(IPetRepository petRepository, IPetTypeRepository petTypeRepository, IColorRepository colorRepository)
 {
     this.PetRepository     = petRepository;
     this.PetTypeRepository = petTypeRepository;
     this.ColorRepository   = colorRepository;
 }
Exemplo n.º 13
0
 public PetValidatorService(IOwnerRepository ownerRepository, IPetTypeRepository petTypeRepository)
 {
     _petTypeRepository = petTypeRepository;
     _ownerRepository   = ownerRepository;
 }
Exemplo n.º 14
0
 public PetTypeService(IPetTypeRepository petTypeRepository)
 {
     _petTypeRepo = petTypeRepository;
 }
Exemplo n.º 15
0
 public UnitOfWork(AdoptMeDataContext context)
 {
     this.context = context;
     Pets         = new PetRepository(context);
     PetTypes     = new PetTypeRepository(context);
 }
Exemplo n.º 16
0
 public PetTypeService(IPetTypeRepository petTypeRepository, IValidatorService validator)
 {
     _petTypeRepository = petTypeRepository;
     _validator         = validator;
 }
Exemplo n.º 17
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IWebHostEnvironment env, IPetRepository petRepository, IOwnerRepository ownerRepository, IPetTypeRepository petTypeRepository)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
                using (var scope = app.ApplicationServices.CreateScope())
                {
                    var ctx = scope.ServiceProvider.GetService <PetShopDBContext>();
                    ctx.Database.EnsureDeleted();
                    ctx.Database.EnsureCreated();
                }
                var data = new InitData(petRepository, ownerRepository, petTypeRepository);
            }

            app.UseCors("All");

            app.UseHttpsRedirection();

            app.UseRouting();

            // Use authentication
            app.UseAuthentication();

            app.UseAuthorization();

            app.UseEndpoints(endpoints =>
            {
                endpoints.MapControllers();
            });
        }
Exemplo n.º 18
0
 public PetTypesController(IPetTypeRepository petTypeRepository)
 {
     _petTypeRepository = petTypeRepository;
 }
Exemplo n.º 19
0
 public DataInitializer(IPetRepository petRepository, IPreviousOwnerRepository previousOwnerRepository, IPetTypeRepository petTypeRepository)
 {
     _petRepository           = petRepository;
     _previousOwnerRepository = previousOwnerRepository;
     _petTypeRepository       = petTypeRepository;
 }
Exemplo n.º 20
0
 public PetTypeService(IPetTypeRepository petTypeRepository, ISearchEngine searchEngine)
 {
     this.PetTypeRepository = petTypeRepository;
     this.SearchEngine      = searchEngine;
 }
Exemplo n.º 21
0
 public TypeService(IPetTypeRepository typeRepository)
 {
     _petTypeRepo = typeRepository;
 }
Exemplo n.º 22
0
 public FakeDB(IOwnerRepository ownerRepository, IPetRepository petRepository, IPetTypeRepository petTypeRepository)
 {
     _ownerRepo   = ownerRepository;
     _petRepo     = petRepository;
     _petTypeRepo = petTypeRepository;
 }
 public InitStaticData(IPetRepository petRepository, IOwnerRepository ownerRepository, IPetTypeRepository petTypeRepository)
 {
     this.PetRepository     = petRepository;
     this.OwnerRepository   = ownerRepository;
     this.PetTypeRepository = petTypeRepository;
 }
Exemplo n.º 24
0
 public PetTypeService(IPetTypeValidatorService petTypeValidationService, IPetTypeRepository petTypeRepository)
 {
     _petTypeValidationService = petTypeValidationService;
     _petTypeRepository        = petTypeRepository;
 }
 public PetTypeService(IPetTypeRepository petTypeService)
 {
     _ptrep = petTypeService;
 }