/// <summary>
        /// Initializes a new instance of the <see cref="ContactsController" /> class.
        /// </summary>
        /// <param name="periodProvider">The period provider.</param>
        /// <param name="source">The source.</param>
        /// <param name="repository">The repository.</param>
        /// <param name="mapper">The mapper.</param>
        /// <exception cref="ArgumentNullException">
        /// periodProvider
        /// or
        /// source
        /// or
        /// repository
        /// or
        /// mapper
        /// </exception>
        public ContactsController(
            IPeriodProvider periodProvider,
            IDataSource <Contact> source,
            IRepository <Contact> repository,
            IMapper mapper)
        {
            if (periodProvider == null)
            {
                throw new ArgumentNullException(nameof(periodProvider));
            }

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

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

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

            this.periodProvider = periodProvider;
            this.source         = source;
            this.repository     = repository;
            this.mapper         = mapper;
        }
Пример #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ApplicationUsersController" /> class.
        /// </summary>
        /// <param name="periodProvider">The period provider.</param>
        /// <param name="source">The source.</param>
        /// <param name="repository">The repository.</param>
        /// <param name="companyRepository">The company repository.</param>
        /// <param name="roleRepository">The role repository.</param>
        /// <param name="mapper">The mapper.</param>
        /// <param name="userManager">The user manager.</param>
        /// <param name="httpContextAccessor">The HTTP context accessor.</param>
        /// <exception cref="ArgumentNullException">
        /// periodProvider
        /// or
        /// source
        /// or
        /// repository
        /// or
        /// companyRepository
        /// or
        /// roleRepository
        /// or
        /// mapper
        /// or
        /// userManager
        /// or
        /// httpContextAccessor
        /// </exception>
        public ApplicationUsersController(
            IPeriodProvider periodProvider,
            IDataSource <ApplicationUser> source,
            IRepository <ApplicationUser> repository,
            IRepository <Company> companyRepository,
            IRepository <Role> roleRepository,
            IMapper mapper,
            IApplicationUserManager userManager,
            IHttpContextAccessor httpContextAccessor)
        {
            if (periodProvider == null)
            {
                throw new ArgumentNullException(nameof(periodProvider));
            }

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

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

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

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

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

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

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

            this.periodProvider      = periodProvider;
            this.source              = source;
            this.repository          = repository;
            this.mapper              = mapper;
            this.userManager         = userManager;
            this.roleRepository      = roleRepository;
            this.companyRepository   = companyRepository;
            this.httpContextAccessor = httpContextAccessor;
        }
Пример #3
0
		public ThemaFactory(
			IThemaLoader loader = null,
			IRoleResolver roleresolver = null,
			IFileNameResolver fileresolver = null,
			ITypeLocator locator = null,
			IEntityResolver entityResolver = null,
			ILogListener log = null,
			IPeriodProvider periodprovider = null) {
			Themas = new ThemaCollection {Factory = this};
			RoleResolver = roleresolver ?? QWebServiceRegistry.Default.RoleResolver;
			FileResolver = fileresolver ?? QWebServiceRegistry.Default.FileNameResolver;
			TypeLocator = locator ?? QWebServiceRegistry.Default.TypeLocator;
			PeriodProvider = periodprovider ?? TypeLocator.Get<IPeriodProvider>().create<IPeriodProvider>();
			EntityResolver = entityResolver ?? TypeLocator.Get<IEntityResolver>().create<IEntityResolver>();
			Sources = new List<IThemaSource>();
			Log = log ?? QWebServiceRegistry.Default.Log;
			Loader = loader ?? new Loader(this);
		}
        /// <summary>
        /// Initializes a new instance of the <see cref="ActivityTasksController" /> class.
        /// </summary>
        /// <param name="periodProvider">The period provider.</param>
        /// <param name="userManager">The user manager.</param>
        /// <param name="httpContextAccessor">The HTTP context accessor.</param>
        /// <param name="repository">The repository.</param>
        /// <param name="mapper">The mapper.</param>
        /// <exception cref="ArgumentNullException">
        /// periodProvider
        /// or
        /// userManager
        /// or
        /// httpContextAccessor
        /// or
        /// repository
        /// or
        /// mapper
        /// </exception>
        public ActivityTasksController(
            IPeriodProvider periodProvider,
            IApplicationUserManager userManager,
            IHttpContextAccessor httpContextAccessor,
            IRepository <ActivityTask> repository,
            IMapper mapper)
        {
            if (periodProvider == null)
            {
                throw new ArgumentNullException(nameof(periodProvider));
            }

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

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

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

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

            this.periodProvider      = periodProvider;
            this.userManager         = userManager;
            this.httpContextAccessor = httpContextAccessor;
            this.repository          = repository;
            this.mapper = mapper;
        }
Пример #5
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ActivitiesController" /> class.
        /// </summary>
        /// <param name="periodProvider">The period provider.</param>
        /// <param name="repository">The repository.</param>
        /// <param name="mapper">The mapper.</param>
        /// <exception cref="ArgumentNullException">
        /// periodProvider
        /// or
        /// repository
        /// or
        /// mapper
        /// </exception>
        public ActivitiesController(
            IPeriodProvider periodProvider,
            IRepository <Activity> repository,
            IMapper mapper)
        {
            if (periodProvider == null)
            {
                throw new ArgumentNullException(nameof(periodProvider));
            }

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

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

            this.periodProvider = periodProvider;
            this.repository     = repository;
            this.mapper         = mapper;
        }