Exemplo n.º 1
0
 public BookingsController(IBookingRepository bookingRepository, ICarRepository carRepository, IEntityFrameworkRepository entityFrameworkRepository, ICustomerRepository customerRepository)
 {
     _bookingRepository         = bookingRepository;
     _carRepository             = carRepository;
     _entityFrameworkRepository = entityFrameworkRepository;
     _customerRepository        = customerRepository;
 }
Exemplo n.º 2
0
        public DamageViewModelDataProvider(IEntityFrameworkRepository <StoredCombatStatistics> storedCombatStatisticsEntityFrameworkRepository, IDamageViewModelFactory damageViewModelFactory)
        {
            Guard.WhenArgument(storedCombatStatisticsEntityFrameworkRepository, nameof(IEntityFrameworkRepository <StoredCombatStatistics>)).IsNull().Throw();
            Guard.WhenArgument(damageViewModelFactory, nameof(IDamageViewModelFactory)).IsNull().Throw();

            this.storedCombatStatisticsEntityFrameworkRepository = storedCombatStatisticsEntityFrameworkRepository;
            this.damageViewModelFactory = damageViewModelFactory;
        }
Exemplo n.º 3
0
        public HealingViewModelDataProvider(IEntityFrameworkRepository <StoredCombatStatistics> storedCombatStatisticsEntityFrameworkRepository, IHealingViewModelFactory healingViewModelFactory)
        {
            Guard.WhenArgument(storedCombatStatisticsEntityFrameworkRepository, nameof(IEntityFrameworkRepository <StoredCombatStatistics>)).IsNull().Throw();
            Guard.WhenArgument(healingViewModelFactory, nameof(IHealingViewModelFactory)).IsNull().Throw();

            this.storedCombatStatisticsEntityFrameworkRepository = storedCombatStatisticsEntityFrameworkRepository;
            this.healingViewModelFactory = healingViewModelFactory;
        }
Exemplo n.º 4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PersonSearchResultHelper" /> class.
 /// </summary>
 /// <param name="repository">The repository.</param>
 /// <param name="serializerSettings">The serializer settings.</param>
 /// <param name="mapper">The mapper.</param>
 public PersonSearchResultHelper(IEntityFrameworkRepository repository,
                                 JsonSerializerSettings serializerSettings,
                                 IMapper mapper)
 {
     this.Repository         = repository;
     this.SerializerSettings = serializerSettings;
     this.Mapper             = mapper;
 }
Exemplo n.º 5
0
        public ParserUserDataProvider(IEntityFrameworkRepository <ParserUser> parserUserEntityFrameworkRepository, IObjectMapperProvider objectMapperProvider)
        {
            Guard.WhenArgument(parserUserEntityFrameworkRepository, nameof(IEntityFrameworkRepository <ParserUser>)).IsNull().Throw();
            Guard.WhenArgument(objectMapperProvider, nameof(IObjectMapperProvider)).IsNull().Throw();

            this.parserUserEntityFrameworkRepository = parserUserEntityFrameworkRepository;
            this.objectMapperProvider = objectMapperProvider;
        }
 public AccountCreationPostDataHandler(IMapper mp, IEntityFrameworkRepository repo, UserManager <GLAAUser> um, IEmailService es, IConfiguration cs)
 {
     mapper        = mp;
     repository    = repo;
     userManager   = um;
     emailService  = es;
     configuration = cs;
 }
        public StoredCombatStatisticsDataProvider(IEntityFrameworkRepository <StoredCombatStatistics> storedCombatStatisticsEntityFrameworkRepository, IObjectMapperProvider objectMapperProvider)
        {
            Guard.WhenArgument(storedCombatStatisticsEntityFrameworkRepository, nameof(IEntityFrameworkRepository <StoredCombatStatistics>)).IsNull().Throw();
            Guard.WhenArgument(objectMapperProvider, nameof(IObjectMapperProvider)).IsNull().Throw();

            this.storedCombatStatisticsEntityFrameworkRepository = storedCombatStatisticsEntityFrameworkRepository;
            this.objectMapperProvider = objectMapperProvider;
        }
Exemplo n.º 8
0
 public TimeseriesController(
     ITimeseriesRepository timeseriesRepository,
     IEntityFrameworkRepository <TimeseriesMetadata> timeseriesMetadataRepository,
     IHubContext <TimeseriesHub> timerseriesHub)
 {
     this.timeseriesRepository         = timeseriesRepository;
     this.timeseriesMetadataRepository = timeseriesMetadataRepository;
     this.timerseriesHub = timerseriesHub;
 }
 public PublicRegisterPostDataHandler(
     IMapper mapper,
     IEntityFrameworkRepository repository,
     ILicenceRepository licenceRepository)
 {
     this.mapper            = mapper;
     this.repository        = repository;
     this.licenceRepository = licenceRepository;
 }
Exemplo n.º 10
0
        public void ThrowArgumentNullException_WhenIEntityFrameworkRepositoryParameterIsNull()
        {
            // Arrange
            IEntityFrameworkRepository <StoredCombatStatistics> storedCombatStatisticsEntityFrameworkRepository = null;

            // Act & Assert
            Assert.That(
                () => new OutputPerSecondViewModelDataProvider(storedCombatStatisticsEntityFrameworkRepository),
                Throws.InstanceOf <ArgumentNullException>().With.Message.Contains(nameof(storedCombatStatisticsEntityFrameworkRepository)));
        }
        public void Setup()
        {
            var config = new AutoMapperConfig().Configure();

            mapper            = config.CreateMapper();
            repository        = Substitute.For <IEntityFrameworkRepository>();
            licenceRepository = Substitute.For <ILicenceRepository>();
            dateTimeProvider  = Substitute.For <IDateTimeProvider>();
            statusRepository  = Substitute.For <IStatusRepository>();
        }
Exemplo n.º 12
0
 public AdminStatusRecordsViewModelBuilder(
     IMapper mapper,
     IEntityFrameworkRepository repository,
     ILicenceRepository licenceRepository,
     IReferenceDataProvider referenceDataProvider)
 {
     _mapper                = mapper;
     _repository            = repository;
     _licenceRepository     = licenceRepository;
     _referenceDataProvider = referenceDataProvider;
 }
Exemplo n.º 13
0
        public void ThrowArgumentNullException_WhenIEntityFrameworkRepositoryParametersIsNull()
        {
            // Arrange
            IEntityFrameworkRepository <ParserUser> parserUserEntityFrameworkRepository = null;
            var objectMapperProvider = new Mock <IObjectMapperProvider>();

            // Act & Assert
            Assert.That(
                () => new ParserUserDataProvider(parserUserEntityFrameworkRepository, objectMapperProvider.Object),
                Throws.InstanceOf <ArgumentNullException>().With.Message.Contains(nameof(IEntityFrameworkRepository <ParserUser>)));
        }
 public LicenceApplicationPostDataHandler(
     IMapper mapper,
     IEntityFrameworkRepository repository, ILicenceRepository licenceRepository,
     IStatusRepository statusRepository,
     IDateTimeProvider dateTimeProvider)
 {
     this.mapper            = mapper;
     this.repository        = repository;
     this.licenceRepository = licenceRepository;
     this.statusRepository  = statusRepository;
     this.dateTimeProvider  = dateTimeProvider;
 }
Exemplo n.º 15
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PersonSearchRequestHelper"/> class.
 /// </summary>
 /// <param name="repository">The repository.</param>
 /// <param name="findPersonController">The find person controller.</param>
 /// <param name="export">The export.</param>
 public PersonSearchRequestHelper(IEntityFrameworkRepository repository,
                                  IFindPersonController findPersonController,
                                  JsonSerializerSettings serializerSettings,
                                  IMapper mapper,
                                  IExport export,
                                  string resultOutputPath)
 {
     this.Repository           = repository;
     this.SerializerSettings   = serializerSettings;
     this.FindPersonController = findPersonController;
     this.Mapper           = mapper;
     this.Export           = export;
     this.ResultOutputPath = resultOutputPath;
 }
Exemplo n.º 16
0
        public PublicRegisterViewModelBuilder(
            IMapper mapper,
            IEntityFrameworkRepository repository,
            ILicenceRepository licenceRepository,
            IReferenceDataProvider referenceDataProvider)
        {
            _mapper                = mapper;
            _licenceRepository     = licenceRepository;
            _referenceDataProvider = referenceDataProvider;

            _ukCountries = repository.GetAll <Country>().Select(x =>
                                                                new SelectListItem {
                Value = x.Name, Text = x.Name
            }).OrderBy(y => y.Text).ToList();
        }
Exemplo n.º 17
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ImportExport" /> class.
        /// </summary>
        /// <param name="repository">The repository.</param>
        /// <param name="serializerSettings">The serializer settings.</param>
        /// <param name="mapper">The mapper.</param>
        /// <param name="import">The import.</param>
        /// <param name="export">The export.</param>
        public ImportExport(IEntityFrameworkRepository repository,
                            JsonSerializerSettings serializerSettings,
                            IMapper mapper,
                            IImport import,
                            IExport export)
        {
            this.Repository         = repository;
            this.SerializerSettings = serializerSettings;
            this.Mapper             = mapper;
            this.Import             = import;
            this.Export             = export;

            this.PersonSearchResultHelper = new PersonSearchResultHelper(repository, serializerSettings, mapper);
            this.PersonHelper             = new PersonHelper(repository, mapper);
        }
        public ShishaTimeData(
            IShishaTimeDbContext dbContext,
            IEntityFrameworkRepository <ShishaBar> barsRepository,
            IEntityFrameworkRepository <User> usersRepository,
            IEntityFrameworkRepository <Region> regionsRepository,
            IEntityFrameworkRepository <Review> reviewsRepository,
            IEntityFrameworkRepository <Rating> ratingsRepository)
        {
            if (dbContext == null)
            {
                throw new ArgumentNullException("DbContext cannot be null.");
            }

            if (barsRepository == null)
            {
                throw new ArgumentNullException("Bars repository cannot be null.");
            }

            if (usersRepository == null)
            {
                throw new ArgumentNullException("Users repository cannot be null.");
            }

            if (regionsRepository == null)
            {
                throw new ArgumentNullException("Regions repository cannot be null.");
            }

            if (reviewsRepository == null)
            {
                throw new ArgumentNullException("Reviews repository cannot be null.");
            }

            if (ratingsRepository == null)
            {
                throw new ArgumentNullException("Ratings repository cannot be null.");
            }

            this.dbContext = dbContext;
            this.Bars      = barsRepository;
            this.Users     = usersRepository;
            this.Regions   = regionsRepository;
            this.Reviews   = reviewsRepository;
            this.Ratings   = ratingsRepository;
        }
Exemplo n.º 19
0
        /// <summary>
        /// Initializes a new instance of the <see cref="PeopleFinder" /> class.
        /// </summary>
        /// <param name="repository">The repository.</param>
        /// <param name="findPersonController">The find person controller.</param>
        /// <param name="serializerSettings">The serializer settings.</param>
        /// <param name="mapper">The mapper.</param>
        /// <param name="export">The export.</param>
        /// <param name="resultOutputPath">The result output path.</param>
        /// <param name="searchWaitMs">The search wait ms.</param>
        public PeopleSearch(IEntityFrameworkRepository repository,
                            IFindPersonController findPersonController,
                            JsonSerializerSettings serializerSettings,
                            IMapper mapper,
                            IExport export,
                            string resultOutputPath,
                            int searchWaitMs)
        {
            this.Repository           = repository;
            this.FindPersonController = findPersonController;
            this.SerializerSettings   = serializerSettings;
            this.Mapper           = mapper;
            this.SearchWaitMs     = searchWaitMs;
            this.ResultOutputPath = resultOutputPath;

            this.PersonSearchRequestHelper = new PersonSearchRequestHelper(repository, findPersonController, serializerSettings, mapper, export, this.ResultOutputPath);
            this.PersonSearchResultHelper  = new PersonSearchResultHelper(repository, serializerSettings, mapper);
        }
Exemplo n.º 20
0
        /// <summary>
        /// Builds this instance.
        /// </summary>
        /// <param name="repository">The repository.</param>
        public static void Build(IEntityFrameworkRepository repository)
        {
            var personSearch = MockDataFactory.GetPersonSearch();

            repository.Create(personSearch);
            repository.Save();

            var person = MockDataFactory.GetPerson(personSearch.Id);

            repository.Create(person);
            repository.Save();

            var addresses = MockDataFactory.GetAddresses(person.Id);

            foreach (var address in addresses)
            {
                repository.Create(address);
                repository.Save();
            }

            var associates = MockDataFactory.GetAssociates(person.Id);

            foreach (var associate in associates)
            {
                repository.Create(associate);
                repository.Save();
            }

            var phones = MockDataFactory.GetPhones(person.Id);

            foreach (var phone in phones)
            {
                repository.Create(phone);
                repository.Save();
            }
        }
        public OutputPerSecondViewModelDataProvider(IEntityFrameworkRepository <StoredCombatStatistics> storedCombatStatisticsEntityFrameworkRepository)
        {
            Guard.WhenArgument(storedCombatStatisticsEntityFrameworkRepository, nameof(storedCombatStatisticsEntityFrameworkRepository)).IsNull().Throw();

            this.storedCombatStatisticsEntityFrameworkRepository = storedCombatStatisticsEntityFrameworkRepository;
        }
Exemplo n.º 22
0
 public CarsController(ICarRepository carRepository, IEntityFrameworkRepository entityFrameworkRepository)
 {
     _carRepository             = carRepository;
     _entityFrameworkRepository = entityFrameworkRepository;
 }
Exemplo n.º 23
0
 public UserService(IEntityFrameworkRepository <User, MsSql1DbContext> userRepository)
 {
     _userRepository = userRepository;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="EntityFrameworkRepository_EntityShouldSoftDelete"/> class.
 /// </summary>
 public EntityFrameworkRepository_EntityShouldSoftDelete()
 {
     Repository = new EntityFrameworkRepository(new ApplicationDbContext());
     InitialDataBuilder.Build(Repository);
 }
 public OrdersRepository(IEntityFrameworkRepository <OrderModel, Guid, CleanArchitectureTemplateDbContext> repository)
 => _repository = repository;
Exemplo n.º 26
0
 public RecipeService(IEntityFrameworkRepository <Recipe> recipeRepository,
                      IIngredientService ingredientService)
 {
     this.recipeRepository  = recipeRepository;
     this.ingredientService = ingredientService;
 }
Exemplo n.º 27
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PersonHelper"/> class.
 /// </summary>
 /// <param name="repository">The repository.</param>
 /// <param name="mapper">The mapper.</param>
 public PersonHelper(IEntityFrameworkRepository repository,
                     IMapper mapper)
 {
     this.Repository = repository;
     this.Mapper     = mapper;
 }
Exemplo n.º 28
0
 public CustomersController(ICustomerRepository customerRepository, IEntityFrameworkRepository entityFrameworkRepository)
 {
     _customerRepository        = customerRepository;
     _entityFrameworkRepository = entityFrameworkRepository;
 }
 public RecipeFamilyService(IEntityFrameworkRepository <RecipeFamily> recipeFamilyRepository,
                            IRecipeService recipeService)
 {
     this.recipeFamilyRepository = recipeFamilyRepository;
     this.recipeService          = recipeService;
 }
 public IngredientService(IEntityFrameworkRepository <Ingredient> ingredientRepository)
 {
     this.ingredientRepository = ingredientRepository;
 }