示例#1
0
        private async Task <string> GetCompoundKeyFromImageIds(IEnumerable <Guid> imageIds)
        {
            var key = "";

            foreach (var id in imageIds)
            {
                key += await _imagesRepository.GetImageKeyById(id);
            }

            return(key);
        }
示例#2
0
        public async Task <bool> ValidateCompoundImageTagDataKey(CompoundImageTagData compoundImageTagData)
        {
            if (string.IsNullOrEmpty(compoundImageTagData.Key))
            {
                return(false);
            }

            var keyParts = compoundImageTagData.Key.SplitInParts(32).ToList();

            var imageIds = await _compoundImageMappingsRepository.GetImageIdsByCompoundImageId(compoundImageTagData.CompoundImageId);

            var imageKeys = new List <string>();

            foreach (var imageId in imageIds)
            {
                imageKeys.Add(await _imagesRepository.GetImageKeyById(imageId));
            }

            return(imageKeys.Count == keyParts.Count && imageKeys.All(keyParts.Contains));
        }