Exemple #1
0
        public async Task <DetailResponse <ContainerRepository> > GetContainerAsync(string id)
        {
            var container = await _containerManager.GetContainerRepoAsync(id, OrgEntityHeader, UserEntityHeader);

            var detailResponse = DetailResponse <ContainerRepository> .Create(container);

            detailResponse.View["password"].IsRequired = false;
            return(detailResponse);
        }
Exemple #2
0
        public async Task AddImageToContainer(string id, [FromBody] TaggedContainer taggedContainer)
        {
            if (taggedContainer == null)
            {
                throw new ArgumentNullException(nameof(taggedContainer));
            }

            var json = JsonConvert.SerializeObject(taggedContainer);

            Console.WriteLine(json);

            var container = await _containerManager.GetContainerRepoAsync(id, OrgEntityHeader, UserEntityHeader);

            if (container == null)
            {
                throw new RecordNotFoundException(nameof(ContainerRepository), id);
            }
            container.Tags.Insert(0, taggedContainer);
            container.PreferredTag = Core.Models.EntityHeader.Create(taggedContainer.Id, taggedContainer.Name);
            await _containerManager.UpdateContainerRepoAsync(container, OrgEntityHeader, UserEntityHeader);
        }