コード例 #1
0
ファイル: DbContext.cs プロジェクト: mizrael/heimdall
        public DbContext(IRepositoryFactory repoFactory, string connectionString)
        {
            if (string.IsNullOrWhiteSpace(connectionString))
            {
                throw new ArgumentNullException(nameof(connectionString));
            }
            if (null == repoFactory)
            {
                throw new ArgumentNullException(nameof(repoFactory));
            }

            this.Services = repoFactory.Create <Entities.Service>(new RepositoryOptions(connectionString, "services"));
            var servicesIxb = new IndexKeysDefinitionBuilder <Entities.Service>();

            this.Services.CreateIndex(servicesIxb.Ascending(u => u.Name), new CreateIndexOptions()
            {
                Unique = true
            });

            this.TraceEvents = repoFactory.Create <Entities.TraceEvent>(new RepositoryOptions(connectionString, "events"));
            var eventsIxb = new IndexKeysDefinitionBuilder <Entities.TraceEvent>();

            this.TraceEvents.CreateIndex(eventsIxb.Ascending(u => u.Name), new CreateIndexOptions()
            {
                Unique = false
            });
        }
コード例 #2
0
 public void AddIncome(IncomeModel model)
 {
     using (var repository = repositoryFactory.Create <Income>())
     {
         repository.Insert(mapper.Map <Income>(model));
     }
 }
コード例 #3
0
        private async void OnAdd()
        {
            var viewModel = _serviceLocator.GetService <CustomerFormViewModel>();

            viewModel.DisplayName = "New Customer";
            viewModel.Date        = DateTime.Now;
            viewModel.IsDirty     = false;
            viewModel.Submitted  += async(sender, e) =>
            {
                var repo  = _repositoryFactory.Create <Customer>();
                var model = new Customer();

                AutoMapper.Map(viewModel, model);

                repo.Add(model);

                viewModel.Id      = model.Id;
                viewModel.IsDirty = false;

                Refresh();

                await _navigator.NavigateBackAsync();
            };

            SetNavigationRestriction(viewModel);

            await _navigator.NavigateToAsync(viewModel);
        }
コード例 #4
0
 public CreditSlipManager(IRepositoryFactory repositoryFactory)
 {
     _repositoryCreditSlip      = repositoryFactory.Create <CreditSlip>();
     _repositoryLink            = repositoryFactory.Create <RelationshipBetweenDocuments>();
     _repositoryCreditSlipSpecs = repositoryFactory.Create <CreditSlipSpecification>();
     _repositoryTax             = repositoryFactory.Create <Tax>();
 }
コード例 #5
0
 public PushNotificationService(IRepositoryFactory repositoryFactory,
                                IClientNotificationHub clientNotificationHub, IMapper mapper)
 {
     _clientNotificationHub = clientNotificationHub;
     _mapper = mapper;
     _pushNotificationRepository = repositoryFactory.Create <PushNotificationEntity>();
     _projectRepository          = repositoryFactory.Create <ProjectEntity>();
 }
コード例 #6
0
 private static void TestFactoryCreate(IRepositoryFactory repoFactory)
 {
     Assert.NotNull(repoFactory.Create <Customer>());
     Assert.NotNull(repoFactory.Create <Customer, int>());
     Assert.NotNull(repoFactory.Create <CustomerWithTwoCompositePrimaryKey, int, string>());
     Assert.NotNull(repoFactory.Create <CustomerWithThreeCompositePrimaryKey, int, string, int>());
     Assert.NotNull(repoFactory.CreateInstance <Repository <Customer> >());
 }
コード例 #7
0
        private IDenormalizerContext <TModel> BuildContext <TModel>() where TModel : class
        {
            var repository = _repositoryFactory.Create <TModel>();
            var lookups    = new Dictionary <string, object>();

            foreach (var lookupType in _denormalizerDescriptors[typeof(TModel).FullName].Lookups)
            {
                lookups[lookupType.FullName] = _repositoryFactory.Create(lookupType);
            }
            return(new DenormalizerContext <TModel>(repository, lookups));
        }
コード例 #8
0
ファイル: GraphSession.cs プロジェクト: maratius1/plot
        private IRepository <T> GetRepositoryOfType <T>()
        {
            var type = typeof(T);

            if (!_repositories.ContainsKey(type))
            {
                _repositories[type] = _repositoryFactory.Create(this, typeof(T));
            }

            return(_repositories[type] as IRepository <T>);
        }
コード例 #9
0
        public CumulativeWeekReportSet(IRepositoryFactory repositoryFactory, DateTime firstDayOfWeek)
        {
            if (firstDayOfWeek.DayOfWeek != DayOfWeek.Monday)
            {
                throw new ArgumentException("First day of week should be a monday", nameof(firstDayOfWeek));
            }

            var nrOfDaysInWeek = 7;

            _activityCumulativeReportBuilder = new ActivityReportBuilder(repositoryFactory.Create($"cumulative_activity_week_report_{firstDayOfWeek:yyyyMMdd}.csv", firstDayOfWeek, nrOfDaysInWeek), firstDayOfWeek, nrOfDaysInWeek);
            _labelCumulativeReportBuilder    = new LabelReportBuilder(repositoryFactory.Create($"cumulative_label_week_report_{firstDayOfWeek:yyyyMMdd}.csv", firstDayOfWeek, nrOfDaysInWeek), firstDayOfWeek, nrOfDaysInWeek);
        }
コード例 #10
0
        public CumulativeMonthReportSet(IRepositoryFactory repositoryFactory, DateTime firstDayOfMonth)
        {
            if (firstDayOfMonth.Day != 1)
            {
                throw new ArgumentException("First day of month should be 1", nameof(firstDayOfMonth));
            }

            var nrOfDaysInMonth = DateTime.DaysInMonth(firstDayOfMonth.Year, firstDayOfMonth.Month);

            _activityCumulativeReportBuilder = new ActivityReportBuilder(repositoryFactory.Create($"cumulative_activity_month_report_{firstDayOfMonth:yyyyMMdd}.csv", firstDayOfMonth, nrOfDaysInMonth), firstDayOfMonth, nrOfDaysInMonth);
            _labelCumulativeReportBuilder    = new LabelReportBuilder(repositoryFactory.Create($"cumulative_label_month_report_{firstDayOfMonth:yyyyMMdd}.csv", firstDayOfMonth, nrOfDaysInMonth), firstDayOfMonth, nrOfDaysInMonth);
        }
コード例 #11
0
        public CommandsDbContext(IRepositoryFactory repoFactory, string connectionString, string dbName)
        {
            if (string.IsNullOrWhiteSpace(connectionString))
                throw new ArgumentNullException("connectionString");
            if (string.IsNullOrWhiteSpace(dbName))
                throw new ArgumentNullException("dbName");

            this.Users = repoFactory.Create<User>(new RepositoryOptions(connectionString, dbName, "users"));
            this.Ideas = repoFactory.Create<Idea>(new RepositoryOptions(connectionString, dbName, "ideas"));
            this.IdeaComments = repoFactory.Create<IdeaComment>(new RepositoryOptions(connectionString, dbName, "ideaComments"));
            this.Areas = repoFactory.Create<Area>(new RepositoryOptions(connectionString, dbName, "areas"));
        }
コード例 #12
0
        public async Task FindTest()
        {
            await AddAsync();

            await using var repo = _factory.Create();
            var one = await repo.FindFirstAsync(x => x.Id.Equals("test"));

            var two = await repo.FindFirstAsync(x => x.Id.Equals("test2"));

            Assert.NotNull(one);
            Assert.Null(two);
        }
コード例 #13
0
 public ProcessedVideoHandler(
     IRepositoryFactory repositoryFactory,
     IService<DomainProjectProcessedScreenshot> projectProcessedScreenshotService,
     Lazy<IService<DomainProjectProcessedVideo>> projectProcessedVideoService,
     IMapper mapper)
 {
     _projectProcessedScreenshotService = projectProcessedScreenshotService;
     _projectProcessedVideoServiceLazy = projectProcessedVideoService;
     _mapper = mapper;
     _processedScreenshotRepository = repositoryFactory.Create<ProcessedScreenshotEntity>();
     _processedVideoRepository = repositoryFactory.Create<ProcessedVideoEntity>();
     _videoQueueRepository = repositoryFactory.Create<VideoQueueEntity>();
 }
コード例 #14
0
        public PerEngineerMonthReportSet(IRepositoryFactory repositoryFactory, DateTime firstDayOfMonth)
        {
            if (firstDayOfMonth.Day != 1)
            {
                throw new ArgumentException("First day of month should be 1", nameof(firstDayOfMonth));
            }

            var nrOfDaysInMonth = DateTime.DaysInMonth(firstDayOfMonth.Year, firstDayOfMonth.Month);

            _activityPerEngineerReportBuilder = new ActivityReportBuilder(repositoryFactory.Create($"engineer_activity_month_report_{firstDayOfMonth:yyyyMMdd}.csv", firstDayOfMonth, nrOfDaysInMonth), firstDayOfMonth, nrOfDaysInMonth);
            _labelPerEngineerReportBuilder    = new LabelReportBuilder(repositoryFactory.Create($"engineer_label_month_report_{firstDayOfMonth:yyyyMMdd}.csv", firstDayOfMonth, nrOfDaysInMonth), firstDayOfMonth, nrOfDaysInMonth);
            _accountReportBuilder             = new AccountReportBuilder(repositoryFactory.Create($"engineer_customer_month_report_{firstDayOfMonth:yyyyMMdd}.csv", firstDayOfMonth, nrOfDaysInMonth), firstDayOfMonth, nrOfDaysInMonth);
        }
コード例 #15
0
 public ProcessedVideoHandler(
     IRepositoryFactory repositoryFactory,
     IService <DomainProjectProcessedScreenshot> projectProcessedScreenshotService,
     Lazy <IService <DomainProjectProcessedVideo> > projectProcessedVideoService,
     IMapper mapper)
 {
     _projectProcessedScreenshotService = projectProcessedScreenshotService;
     _projectProcessedVideoServiceLazy  = projectProcessedVideoService;
     _mapper = mapper;
     _processedScreenshotRepository = repositoryFactory.Create <ProcessedScreenshotEntity>();
     _processedVideoRepository      = repositoryFactory.Create <ProcessedVideoEntity>();
     _videoQueueRepository          = repositoryFactory.Create <VideoQueueEntity>();
 }
コード例 #16
0
        public TRepo GetByUser(int userId)
        {
            TRepo rep;

            lock (padlock)
            {
                //bool inDictionary;

                if (UserRepositories == null)
                {
                    UserRepositories = new Dictionary <int, TRepo>();
                }

                if (UserRepositories.ContainsKey(userId))
                {
                    rep = UserRepositories[userId];
                    if (rep == null)
                    {
                        rep = _dbRepositoryFactory.Create(userId, this);
                    }
                }
                else
                {
                    rep = _dbRepositoryFactory.Create(userId, this);
                    UserRepositories.Add(userId, rep);
                }


                //try
                //{
                //    inDictionary = UserRepositories.TryGetValue(userId, out rep);
                //}
                //catch (Exception)
                //{
                //    throw new Exception("");
                //}

                //if (rep == null)
                //{
                //    rep = _dbRepositoryFactory.Create(userId, this);
                //}

                //if (!inDictionary)
                //{
                //    UserRepositories.Add(userId, rep);
                //}
            }
            return(rep);
        }
コード例 #17
0
 public UserProfileService(IRepositoryFactory repositoryFactory,
                           IMappingEngine mappingEngine,
                           IService <DomainEmailMembership> membershipService,
                           IService <DomainProject> projectService,
                           IConfigurationProvider configurationProvider)
 {
     _mappingEngine            = mappingEngine;
     _membershipService        = membershipService;
     _projectService           = projectService;
     _profileRepository        = repositoryFactory.Create <UserProfileEntity>(Tables.UserProfile);
     _storageSpaceRepository   = repositoryFactory.Create <StorageSpaceEntity>(Tables.StorageSpace);
     _userRolesRepository      = repositoryFactory.Create <UserRoleEntity>(Tables.UserRole);
     _authenticationRepository = repositoryFactory.Create <AuthenticationEntity>(Tables.Authentication);
     _defaultUserStorageSpace  = long.Parse(configurationProvider.Get(FrontEndSettings.DefaultMaxUserCapacity));
 }
コード例 #18
0
 public AdminProjectService(IRepositoryFactory repositoryFactory, IUserRepository userRepository, IProductWriterForAdmin productWriterForAdmin, IFileSystem fileSystem)
 {
     _projectRepository = repositoryFactory.Create<ProjectEntity>();
     _userRepository = userRepository;
     _productWriterForAdmin = productWriterForAdmin;
     _fileSystem = fileSystem;
 }
コード例 #19
0
        private static void TestUpdateRange(IRepositoryFactory repoFactory)
        {
            var repo = repoFactory.Create <Customer>();

            const string expectedName = "New Random Name";
            const string name         = "Random Name";

            var entities = new List <Customer>
            {
                new Customer {
                    Id = 1, Name = name
                },
                new Customer {
                    Id = 2, Name = name
                }
            };

            repo.Add(entities);

            var entitiesInDb = repo.FindAll(x => x.Name.Equals(name));

            foreach (var entityInDb in entitiesInDb)
            {
                entityInDb.Name = expectedName;
            }

            repo.Update(entitiesInDb);

            Assert.Equal(2, repo.Count(x => x.Name.Equals(expectedName)));
        }
        private static void TestToDictionary(IRepositoryFactory repoFactory)
        {
            var repo = repoFactory.Create <Customer>();

            const string name = "Random Name";

            var options = new QueryOptions <Customer>();
            var entity  = new Customer {
                Id = 1, Name = name
            };
            var expectedDictionary = new Dictionary <int, Customer>();
            var expectedDictionaryByElementSelector = new Dictionary <int, string>();

            expectedDictionary.Add(entity.Id, entity);
            expectedDictionaryByElementSelector.Add(entity.Id, entity.Name);

            Assert.False(expectedDictionary.All(x => repo.ToDictionary(y => y.Id).ContainsKey(x.Key)));
            Assert.False(expectedDictionary.All(x => repo.ToDictionary(options, y => y.Id).Result.ContainsKey(x.Key)));
            Assert.False(expectedDictionaryByElementSelector.All(x => repo.ToDictionary(y => y.Id, y => y.Name).Contains(x)));
            Assert.False(expectedDictionaryByElementSelector.All(x => repo.ToDictionary(options, y => y.Id, y => y.Name).Result.Contains(x)));

            repo.Add(entity);

            Assert.True(expectedDictionary.All(x => repo.ToDictionary(y => y.Id).ContainsKey(x.Key)));
            Assert.True(expectedDictionary.All(x => repo.ToDictionary(options, y => y.Id).Result.ContainsKey(x.Key)));
            Assert.True(expectedDictionaryByElementSelector.All(x => repo.ToDictionary(y => y.Id, y => y.Name).Contains(x)));
            Assert.True(expectedDictionaryByElementSelector.All(x => repo.ToDictionary(options, y => y.Id, y => y.Name).Result.Contains(x)));
        }
コード例 #21
0
        private static void TestGroupByWithOptions(IRepositoryFactory repoFactory)
        {
            var repo     = (Repository <Customer>)repoFactory.Create <Customer>();
            var customer = new Customer {
                Name = "Random Name"
            };

            repo.Add(customer);

            var queryOptions = new QueryOptions <Customer>().SatisfyBy(x => x.Id == customer.Id);

            Assert.True(repo.CacheEnabled);
            Assert.False(repo.CacheUsed);

            Assert.NotEmpty(repo.GroupBy(queryOptions, x => x.Id, (key, g) => key).Result);

            Assert.False(repo.CacheUsed);

            Assert.NotEmpty(repo.GroupBy(queryOptions, x => x.Id, (key, g) => key).Result);

            Assert.True(repo.CacheUsed);

            repo.CacheEnabled = false;

            Assert.NotEmpty(repo.GroupBy(queryOptions, x => x.Id, (key, g) => key).Result);

            Assert.False(repo.CacheUsed);
        }
コード例 #22
0
        private static void TestExists(IRepositoryFactory repoFactory)
        {
            var repo     = (Repository <Customer>)repoFactory.Create <Customer>();
            var customer = new Customer {
                Name = "Random Name"
            };

            repo.Add(customer);

            Assert.True(repo.CacheEnabled);
            Assert.False(repo.CacheUsed);

            Assert.True(repo.Exists(x => x.Id == customer.Id));

            Assert.False(repo.CacheUsed);

            Assert.True(repo.Exists(x => x.Id == customer.Id));

            Assert.True(repo.CacheUsed);

            repo.CacheEnabled = false;

            Assert.True(repo.Exists(x => x.Id == customer.Id));

            Assert.False(repo.CacheUsed);
        }
コード例 #23
0
        private static void TestGroupBy(IRepositoryFactory repoFactory)
        {
            var repo     = (Repository <Customer>)repoFactory.Create <Customer>();
            var customer = new Customer {
                Name = "Random Name"
            };

            repo.Add(customer);

            Assert.True(repo.CacheEnabled);
            Assert.False(repo.CacheUsed);

            Assert.NotEmpty(repo.GroupBy(x => x.Id, (key, g) => key));

            Assert.False(repo.CacheUsed);

            Assert.NotEmpty(repo.GroupBy(x => x.Id, (key, g) => key));

            Assert.True(repo.CacheUsed);

            repo.CacheEnabled = false;

            Assert.NotEmpty(repo.GroupBy(x => x.Id, (key, g) => key));

            Assert.False(repo.CacheUsed);
        }
コード例 #24
0
        private static void TestCountWithOptions(IRepositoryFactory repoFactory)
        {
            var repo     = (Repository <Customer>)repoFactory.Create <Customer>();
            var customer = new Customer {
                Name = "Random Name"
            };

            repo.Add(customer);

            var queryOptions = new QueryOptions <Customer>().SatisfyBy(x => x.Id == customer.Id);

            Assert.True(repo.CacheEnabled);
            Assert.False(repo.CacheUsed);

            Assert.Equal(1, repo.Count(queryOptions));

            Assert.False(repo.CacheUsed);

            Assert.Equal(1, repo.Count(queryOptions));

            Assert.True(repo.CacheUsed);

            repo.CacheEnabled = false;

            Assert.Equal(1, repo.Count(queryOptions));

            Assert.False(repo.CacheUsed);
        }
コード例 #25
0
        private static async Task TestToDictionaryAsync(IRepositoryFactory repoFactory)
        {
            var repo     = (Repository <Customer>)repoFactory.Create <Customer>();
            var customer = new Customer {
                Name = "Random Name"
            };

            await repo.AddAsync(customer);

            Assert.True(repo.CacheEnabled);
            Assert.False(repo.CacheUsed);

            Assert.NotEmpty(await repo.ToDictionaryAsync(x => x.Id));

            Assert.False(repo.CacheUsed);

            Assert.NotEmpty(await repo.ToDictionaryAsync(x => x.Id));

            Assert.True(repo.CacheUsed);

            repo.CacheEnabled = false;

            Assert.NotEmpty(await repo.ToDictionaryAsync(x => x.Id));

            Assert.False(repo.CacheUsed);
        }
コード例 #26
0
        public IEnumerable <RepositoryBase> Load(string path)
        {
            var list = new List <RepositoryBase>();

            if (!File.Exists(path))
            {
                return(Enumerable.Empty <RepositoryBase>());
            }

            try
            {
                var document = new XmlDocument();
                document.Load(path);

                var repositories = document.SelectNodes("repositories/repository");
                if (repositories == null)
                {
                    return(Enumerable.Empty <RepositoryBase>());
                }

                foreach (XmlNode node in repositories)
                {
                    string type           = node.ChildNodes.Item(0).InnerText;
                    string repositoryPath = node.ChildNodes.Item(1).InnerText;

                    list.Add(_repositoryFactory.Create(type, repositoryPath));
                }
            }
            catch (Exception exception)
            {
                throw;
            }

            return(list);
        }
コード例 #27
0
        private static async Task TestFindWithIdAsync(IRepositoryFactory repoFactory)
        {
            var repo     = (Repository <Customer>)repoFactory.Create <Customer>();
            var customer = new Customer {
                Name = "Random Name"
            };

            await repo.AddAsync(customer);

            Assert.True(repo.CacheEnabled);
            Assert.False(repo.CacheUsed);

            Assert.NotNull(await repo.FindAsync(customer.Id));

            Assert.False(repo.CacheUsed);

            Assert.NotNull(await repo.FindAsync(customer.Id));

            Assert.True(repo.CacheUsed);

            repo.CacheEnabled = false;

            Assert.NotNull(await repo.FindAsync(customer.Id));

            Assert.False(repo.CacheUsed);
        }
コード例 #28
0
        private static async Task TestCountAsync(IRepositoryFactory repoFactory)
        {
            var repo     = (Repository <Customer>)repoFactory.Create <Customer>();
            var customer = new Customer {
                Name = "Random Name"
            };

            await repo.AddAsync(customer);

            Assert.True(repo.CacheEnabled);
            Assert.False(repo.CacheUsed);

            Assert.Equal(1, await repo.CountAsync(x => x.Id == customer.Id));

            Assert.False(repo.CacheUsed);

            Assert.Equal(1, await repo.CountAsync(x => x.Id == customer.Id));

            Assert.True(repo.CacheUsed);

            repo.CacheEnabled = false;

            Assert.Equal(1, await repo.CountAsync(x => x.Id == customer.Id));

            Assert.False(repo.CacheUsed);
        }
コード例 #29
0
        public T GetById <T>(Guid id) where T : AggregateRoot, new()
        {
            var obj = _factory.Create <T>().GetById(id);

            RegisterForTracking(obj);
            return(obj);
        }
コード例 #30
0
        private static async Task TestGroupByAsync(IRepositoryFactory repoFactory)
        {
            var repo = repoFactory.Create <Customer>();

            const string name = "Random Name";

            var options  = new QueryOptions <Customer>();
            var entities = new List <Customer>()
            {
                new Customer {
                    Id = 1, Name = name
                }
            };

            var expectedGroup = entities.GroupBy(y => y.Id);
            var expectedGroupByElementSelector = entities.GroupBy(y => y.Id, y => y.Name);

            Assert.False(expectedGroupByElementSelector.All(x => repo.GroupByAsync(y => y.Id, (key, g) => key).Result.Contains(x.Key)));
            Assert.False(expectedGroupByElementSelector.All(x => repo.GroupByAsync(options, y => y.Id, (key, g) => key).Result.Result.Contains(x.Key)));

            await repo.AddAsync(entities);

            Assert.True(expectedGroupByElementSelector.All(x => repo.GroupByAsync(y => y.Id, (key, g) => key).Result.Contains(x.Key)));
            Assert.True(expectedGroupByElementSelector.All(x => repo.GroupByAsync(options, y => y.Id, (key, g) => key).Result.Result.Contains(x.Key)));
        }
コード例 #31
0
        public void DoSomething()
        {
            var repository = _repositoryFactory.Create();

            // Используем созданный AbstractRepository
            repository.Save();
        }
コード例 #32
0
        public DbContext(IRepositoryFactory repoFactory, string connectionString, string dbName)
        {
            if (string.IsNullOrWhiteSpace(connectionString))
            {
                throw new ArgumentNullException("connectionString");
            }
            if (string.IsNullOrWhiteSpace(dbName))
            {
                throw new ArgumentNullException("dbName");
            }

            this.Users    = repoFactory.Create <User>(new RepositoryOptions(connectionString, dbName, "Users"));
            this.Posts    = repoFactory.Create <Post>(new RepositoryOptions(connectionString, dbName, "Posts"));
            this.Friends  = repoFactory.Create <Friends>(new RepositoryOptions(connectionString, dbName, "Friends"));
            this.Comments = repoFactory.Create <Comment>(new RepositoryOptions(connectionString, dbName, "Comments"));
        }
コード例 #33
0
        private static async Task TestExistsWithOptionsAsync(IRepositoryFactory repoFactory)
        {
            var repo     = (Repository <Customer>)repoFactory.Create <Customer>();
            var customer = new Customer {
                Name = "Random Name"
            };

            await repo.AddAsync(customer);

            var queryOptions = new QueryOptions <Customer>().SatisfyBy(x => x.Id == customer.Id);

            Assert.True(repo.CacheEnabled);
            Assert.False(repo.CacheUsed);

            Assert.True(await repo.ExistsAsync(queryOptions));

            Assert.False(repo.CacheUsed);

            Assert.True(await repo.ExistsAsync(queryOptions));

            Assert.True(repo.CacheUsed);

            repo.CacheEnabled = false;

            Assert.True(await repo.ExistsAsync(queryOptions));

            Assert.False(repo.CacheUsed);
        }
コード例 #34
0
 public EmailSenderService(
     IRepositoryFactory repositoryFactory,
     IMailerRepository mailerRepository,
     IMapper mapper)
 {
     _mailerRepository = mailerRepository;
     _mapper = mapper;
     _sendEmailRepository = repositoryFactory.Create<SendEmailEntity>();
 }
コード例 #35
0
        /// <summary>
        /// Initializes a new instance of the DashboardHandlerBase class.
        /// </summary>
        /// <param name="repositoryFactory">The repository factory to use.</param>
        protected DashboardHandlerBase(IRepositoryFactory repositoryFactory)
        {
            if (repositoryFactory == null)
            {
                throw new ArgumentNullException("repositoryFactory", "repositoryFactory cannot be null.");
            }

            this.Helper = new HandlerHelper(this);
            this.Repository = repositoryFactory.Create();
        }
コード例 #36
0
ファイル: TaskKeeper.cs プロジェクト: GusLab/video-portal
        public TaskKeeper(
            IMapper mapper,
            IRepositoryFactory repositoryFactory,
            IProjectRepository projectRepository,
            IService<DomainProjectProcessedScreenshot> projectProcessedScreenshotService,
            IService<DomainProjectProcessedVideo> projectProcessedVideoService)
        {
            _mapper = mapper;

            _projectRepository = projectRepository;
            _projectProcessedScreenshotService = projectProcessedScreenshotService;
            _projectProcessedVideoService = projectProcessedVideoService;

            _processedScreenshotRepository = repositoryFactory.Create<ProcessedScreenshotEntity>();
            _processedVideoRepository = repositoryFactory.Create<ProcessedVideoEntity>();
            _videoQueueRepository = repositoryFactory.Create<VideoQueueEntity>();

            _lastSave = DateTime.MinValue;
        }
コード例 #37
0
ファイル: CommentService.cs プロジェクト: GusLab/video-portal
 public CommentService(IRepositoryFactory repositoryFactory,
     ICommentRepository commentRepository,
     IUserRepository userRepository,
     IAuthenticator authenticator,
     IMapper mapper)
 {
     _commentRepository = commentRepository;
     _userRepository = userRepository;
     _authenticator = authenticator;
     _mapper = mapper;
     _projectRepository = repositoryFactory.Create<ProjectEntity>();
 }
コード例 #38
0
 public EmailNotificationService(
     IRepositoryFactory repositoryFactory,
     IEmailSenderService emailSenderService,
     IPortalFrontendSettings settings,
     IUserService userService,
     IProductIdExtractor productIdExtractor,
     IProjectUriProvider projectUriProvider,
     IUserUriProvider userUriProvider)
 {
     _emailSenderService = emailSenderService;
     _settings = settings;
     _productIdExtractor = productIdExtractor;
     _userService = userService;
     _projectUriProvider = projectUriProvider;
     _userUriProvider = userUriProvider;
     _emailRepository = repositoryFactory.Create<SendEmailEntity>();
 }
コード例 #39
0
 public AdminUserService(
     IRepositoryFactory repositoryFactory,
     IUserRepository userRepository,
     IProjectRepository projectRepository,
     IPasswordService passwordService,
     IProjectService projectService,
     IProductWriterForAdmin productWriterForAdmin,
     IMapper mapper)
 {
     _userRepository = userRepository;
     _passwordService = passwordService;
     _projectService = projectService;
     _productWriterForAdmin = productWriterForAdmin;
     _mapper = mapper;
     _fileRepository = repositoryFactory.Create<FileEntity>();
     _projectRepository = projectRepository;
 }
コード例 #40
0
 public PasswordRecoveryService(
     IRepositoryFactory repositoryFactory,
     IUserRepository userRepository,
     IMailerRepository mailerRepository,
     IPasswordRecoveryFactory passwordRecoveryFactory,
     IPortalFrontendSettings settings,
     IRecoveryLinkService recoveryLinkService,
     IPasswordService passwordService)
 {
     _userRepository = userRepository;
     _passwordRecoveryFactory = passwordRecoveryFactory;
     _settings = settings;
     _recoveryLinkService = recoveryLinkService;
     _passwordService = passwordService;
     _mailerRepository = mailerRepository;
     _passwordRecoverRepository = repositoryFactory.Create<PasswordRecoveryEntity>();
 }
コード例 #41
0
 public LastProjectService(IRepositoryFactory repositoryFactory)
 {
     _projectRepository = repositoryFactory.Create<ProjectEntity>();
 }
コード例 #42
0
ファイル: FileSystem.cs プロジェクト: GusLab/video-portal
 public FileSystem(IUserRepository userRepository, IRepositoryFactory repositoryFactory, CloudBlobClient blobClient)
 {
     _userRepository = userRepository;
     _blobClient = blobClient;
     _fileRepository = repositoryFactory.Create<FileEntity>();
 }