Ejemplo n.º 1
0
        public UsersAsyncService(IUsersAsyncRepository asyncRepository, IDisposableUnitOfWorkFactory unitOfWorkFactory, IFileDownloadProvider fileDownloadProvider, IProfilePictureFactory profilePictureFactory, IAddressFactory addressFactory)
            : base(asyncRepository, unitOfWorkFactory)
        {
            Guard.WhenArgument(asyncRepository, nameof(IUsersAsyncRepository)).IsNull().Throw();
            Guard.WhenArgument(fileDownloadProvider, nameof(IFileDownloadProvider)).IsNull().Throw();
            Guard.WhenArgument(profilePictureFactory, nameof(IProfilePictureFactory)).IsNull().Throw();
            Guard.WhenArgument(addressFactory, nameof(IAddressFactory)).IsNull().Throw();

            this.asyncRepository       = asyncRepository;
            this.fileDownloadProvider  = fileDownloadProvider;
            this.profilePictureFactory = profilePictureFactory;
            this.addressFactory        = addressFactory;
        }
Ejemplo n.º 2
0
        public DishesAsyncService(IDishesAsyncRepository dishesAsyncRepository, IUsersAsyncRepository usersAsyncRepository, IInitializedDishFactory dishFactory, IInitializedVideoItemFactory videoItemFactory, IInitializedPhotoItemFactory photoItemFactory, IDisposableUnitOfWorkFactory unitOfWorkFactory)
            : base(dishesAsyncRepository, unitOfWorkFactory)
        {
            Guard.WhenArgument(dishesAsyncRepository, nameof(IDishesAsyncRepository)).IsNull().Throw();
            Guard.WhenArgument(usersAsyncRepository, nameof(IUsersAsyncRepository)).IsNull().Throw();
            Guard.WhenArgument(dishFactory, nameof(IDishFactory)).IsNull().Throw();
            Guard.WhenArgument(videoItemFactory, nameof(IVideoItemFactory)).IsNull().Throw();
            Guard.WhenArgument(photoItemFactory, nameof(IPhotoItemFactory)).IsNull().Throw();

            this.dishesAsyncRepository = dishesAsyncRepository;
            this.usersAsyncRepository  = usersAsyncRepository;
            this.dishFactory           = dishFactory;
            this.videoItemFactory      = videoItemFactory;
            this.photoItemFactory      = photoItemFactory;
        }
        public UsersRegistrationAsyncService(IUsersAsyncRepository usersAsyncRepository, IProfilePicturesAsyncRepository profilePicturesAsyncRepository, IDisposableUnitOfWorkFactory unitOfWorkFactory, IInitializedUserFactory userDbModelFactory)
            : base(usersAsyncRepository, unitOfWorkFactory)
        {
            if (userDbModelFactory == null)
            {
                throw new ArgumentNullException(nameof(IInitializedUserFactory));
            }

            if (usersAsyncRepository == null)
            {
                throw new ArgumentNullException(nameof(IUsersAsyncRepository));
            }

            if (profilePicturesAsyncRepository == null)
            {
                throw new ArgumentNullException(nameof(IProfilePicturesAsyncRepository));
            }

            this.userDbModelFactory             = userDbModelFactory;
            this.usersAsyncRepository           = usersAsyncRepository;
            this.profilePicturesAsyncRepository = profilePicturesAsyncRepository;
        }