Пример #1
0
        public static SvcRepositoryDto ToDto(this ISvcRepository repo)
        {
            var dto = new SvcRepositoryDto
            {
                CheckoutUser = repo.CheckoutUser.ToDto(),
                PushUser     = repo.PushUser.ToDto(),
                Id           = repo.Id,
                Type         = repo.Type,
                Name         = repo.Name,
                Uri          = repo.Uri,
                DefaultCommitMessagePrefix = repo.DefaultCommitMessagePrefix,
                MappedCheckoutCredentials  = repo.MappedCheckoutCredentials?.ToDto()
            };

            return(dto);
        }
Пример #2
0
        public static SvcRepository ToSvcRepository(this SvcRepositoryDto dto)
        {
            var repo = new SvcRepository
            {
                Name = dto.Name,
                Uri  = dto.Uri,
                DefaultCommitMessagePrefix = dto.DefaultCommitMessagePrefix,
                Id           = dto.Id,
                Type         = dto.Type,
                CheckoutUser = dto.CheckoutUser.ToUser(),
                PushUser     = dto.PushUser.ToUser(),
                MappedCheckoutCredentials = dto.MappedCheckoutCredentials?.ToCredentials()
            };

            return(repo);
        }