public RepositoryPermissionService(IRepositoryRepository repository, IRoleProvider roleProvider,
                                    ITeamRepository teamRepository)
 {
     Repository     = repository;
     RoleProvider   = roleProvider;
     TeamRepository = teamRepository;
 }
Exemple #2
0
        /// <summary>
        /// Correct a repository name have the same case as it has in the database
        /// If the repo is not in the database, then the name is returned unchanged
        /// </summary>
        public static string NormalizeRepositoryName(string incomingRepositoryName, IRepositoryRepository repositoryRepository)
        {
            // In the most common case, we're just going to find the repo straight off
            // This is fastest if it succeeds, but might be case-sensitive
            var knownRepos = repositoryRepository.GetRepository(incomingRepositoryName);

            if (knownRepos != null)
            {
                return(knownRepos.Name);
            }

            // We might have a real repo, but it wasn't returned by GetRepository, because that's not
            // guaranteed to be case insensitive (very difficult to assure this with EF, because it's the back
            // end which matters, not EF itself)
            // We'll try and check all repos in a slow but safe fashion
            knownRepos =
                repositoryRepository.GetAllRepositories()
                .FirstOrDefault(
                    repo => repo.Name.Equals(incomingRepositoryName, StringComparison.OrdinalIgnoreCase));
            if (knownRepos != null)
            {
                // We've found it now
                return(knownRepos.Name);
            }

            // We can't find this repo - it's probably invalid, but it's not
            // our job to worry about that
            return(incomingRepositoryName);
        }
Exemple #3
0
 public TeamController(IMembershipService membershipService, IRepositoryRepository repositoryRepository,
                       ITeamRepository teamRepository)
 {
     MembershipService    = membershipService;
     RepositoryRepository = repositoryRepository;
     TeamRepository       = teamRepository;
 }
        /// <summary>
        /// Correct a repository name have the same case as it has in the database
        /// If the repo is not in the database, then the name is returned unchanged
        /// </summary>
        public static string NormalizeRepositoryName(string incomingRepositoryName, IRepositoryRepository repositoryRepository)
        {
            // In the most common case, we're just going to find the repo straight off
            // This is fastest if it succeeds, but might be case-sensitive
            var knownRepos = repositoryRepository.GetRepository(incomingRepositoryName);
            if (knownRepos != null)
            {
                return knownRepos.Name;
            }

            // We might have a real repo, but it wasn't returned by GetRepository, because that's not 
            // guaranteed to be case insensitive (very difficult to assure this with EF, because it's the back
            // end which matters, not EF itself)
            // We'll try and check all repos in a slow but safe fashion
            knownRepos =
                repositoryRepository.GetAllRepositories()
                    .FirstOrDefault(
                        repo => repo.Name.Equals(incomingRepositoryName, StringComparison.OrdinalIgnoreCase));
            if (knownRepos != null)
            {
                // We've found it now
                return knownRepos.Name;
            }

            // We can't find this repo - it's probably invalid, but it's not
            // our job to worry about that
            return incomingRepositoryName;
        }
Exemple #5
0
 public RepositoryController(
     IRepositoryRepository repositoryRepository,
     IRepositoryConvertor repositoryConvertor)
 {
     this.repositoryRepository = repositoryRepository;
     this.repositoryConvertor  = repositoryConvertor;
 }
 public RepositoryController(ITeamRepository teamRepository, IRepositoryRepository repositoryRepository,
                             IMembershipService membershipService, IRepositoryPermissionService repositoryPermissionService)
 {
     TeamRepository              = teamRepository;
     RepositoryRepository        = repositoryRepository;
     MembershipService           = membershipService;
     RepositoryPermissionService = repositoryPermissionService;
 }
Exemple #7
0
 public DatabaseResetManager(IRepositoryRepository repositoryRepository, IRoleProvider roleProvider,
                             ITeamRepository teamRepository, IMembershipService users)
 {
     Repository     = repositoryRepository;
     RoleProvider   = roleProvider;
     TeamRepository = teamRepository;
     Users          = users;
 }
 public ValidationController(IRepositoryRepository repoRepo, IMembershipService membershipService,
                             ITeamRepository teamRepository, IActionContextAccessor actionContextAccessor)
 {
     RepoRepo                   = repoRepo;
     MembershipService          = membershipService;
     TeamRepo                   = teamRepository;
     this.actionContextAccessor = actionContextAccessor;
 }
 public GitController(IRepositoryPermissionService repositoryPermissionService,
                      IRepositoryRepository repositoryRepository, IMembershipService membershipService, IGitService gitService)
 {
     RepositoryPermissionService = repositoryPermissionService;
     RepositoryRepository        = repositoryRepository;
     MembershipService           = membershipService;
     GitService = gitService;
 }
 public GitAuthorizationHandler(IHttpContextAccessor httpContextAccessor, IMembershipService membershipService,
                                IAuthenticationProvider authenticationProvider, IRepositoryPermissionService repositoryPermissionService,
                                IRepositoryRepository repositoryRepository)
 {
     _httpContextAccessor        = httpContextAccessor;
     MembershipService           = membershipService;
     AuthenticationProvider      = authenticationProvider;
     RepositoryPermissionService = repositoryPermissionService;
     RepositoryRepository        = repositoryRepository;
 }
 public MockServices(MockRepository mocks)
 {
   _mocks = mocks;
   _hooksRepository = MockRepository.GenerateStub<IHooksRepository>();
   _projectManifestRepository = MockRepository.GenerateStub<IProjectManifestRepository>();
   _fileSystemEntryRepository = MockRepository.GenerateStub<IFileSystemEntryRepository>();
   _currentProjectRepository = MockRepository.GenerateStub<ICurrentProjectRepository>();
   _repositorySetRepository = MockRepository.GenerateStub<IRepositorySetRepository>();
   _repositoryRepository = MockRepository.GenerateStub<IRepositoryRepository>();
   _configurationRepository = MockRepository.GenerateStub<IConfigurationRepository>();
 }
Exemple #12
0
 public RepositoryController(IOrganisationRepository organisationRepository,
                             IRepositoryRepository repositoryRepository,
                             IRepositoryPersistence repositoryPersistence,
                             ICredentialsRepository credentialsRepository,
                             ILogger <RepositoryController> logger)
 {
     _organisationRepository = organisationRepository;
     _repositoryRepository   = repositoryRepository;
     _repositoryPersistence  = repositoryPersistence;
     _credentialsRepository  = credentialsRepository;
     _logger = logger;
 }
        public RepositoryService(IMapper mapper, IRepositoryRepository repositoryRepository, IOwnerRepository ownerRepository)
        {
            var httpClient = new HttpClient
            {
                BaseAddress           = new Uri(Environment.GetEnvironmentVariable("GitHubUrl")),
                DefaultRequestHeaders = { { "User-Agent", "GitHubApi" } }
            };

            _mapper = mapper;
            _repositoryRepository = repositoryRepository;
            _ownerRepository      = ownerRepository;
            _githubService        = RestService.For <IGitHubApi>(httpClient);
        }
        // private IRepositorySearchRepository repositorySearchRepository;

        public RepositoryManager(
            IRepositorySnapshotRepository repositorySnapshotRepository,
            IRepositoryCurrentStateRepository repositoryCurrentStateRepository,
            IRepositorySourceManager repositorySourceManager,
            IRepositoryRepository repositoryRepository
            //IRepositorySearchRepository repositorySearchRepository
            )
        {
            this.repositorySnapshotRepository     = repositorySnapshotRepository;
            this.repositoryCurrentStateRepository = repositoryCurrentStateRepository;
            this.repositorySourceManager          = repositorySourceManager;
            this.repositoryRepository             = repositoryRepository;
            // this.repositorySearchRepository = repositorySearchRepository;
        }
        protected override ValidationResult IsValid(object value, ValidationContext context)
        {
            if (value == null)
            {
                return(new ValidationResult("empty repo name?"));
            }

            IRepositoryRepository RepositoryRepository = DependencyResolver.Current.GetService <IRepositoryRepository>();

            if (RepositoryRepository.NameIsUnique(value.ToString(), ((RepositoryDetailModel)context.ObjectInstance).Id))
            {
                return(ValidationResult.Success);
            }
            return(new ValidationResult(Resources.Validation_Duplicate_Name));
        }
Exemple #16
0
 public RepositorySynchronizer(IRepositoryRepository repositoryRepository)
 {
     _repositoryRepository = repositoryRepository;
 }
 public RepositorySets(ICurrentProjectRepository currentProjectRepository, IRepositoryRepository repositoryRepository, IRepositorySetRepository repositorySetRepository)
 {
   _currentProjectRepository = currentProjectRepository;
   _repositorySetRepository = repositorySetRepository;
   _repositoryRepository = repositoryRepository;
 }
 public RepositorySets(ICurrentProjectRepository currentProjectRepository, IRepositoryRepository repositoryRepository, IRepositorySetRepository repositorySetRepository)
 {
     _currentProjectRepository = currentProjectRepository;
     _repositorySetRepository  = repositorySetRepository;
     _repositoryRepository     = repositoryRepository;
 }
Exemple #19
0
 public HomeController(IRepositoryRepository repo)
 {
     repository = repo;
 }
Exemple #20
0
 public NavigationMenuViewComponent(IRepositoryRepository repo)
 {
     repository = repo;
 }
Exemple #21
0
 public RepositoryService(IRepositoryRepository repositoryRepository)
 {
     _repositoryRepository = repositoryRepository;
     Errors = new Dictionary <string, string>();
 }
Exemple #22
0
 public RepositoryNameNormalizerAttribute(IRepositoryRepository repositoryRepository, string repositoryNameParameterName)
 {
     RepositoryRepository         = repositoryRepository;
     _repositoryNameParameterName = repositoryNameParameterName;
 }
 public RepositorySetRepository(IRepositoryRepository repositoryRepository, ICurrentConfiguration currentConfiguration)
 {
   _repositoryRepository = repositoryRepository;
   _currentConfiguration = currentConfiguration;
 }