Esempio n. 1
0
 public Result <ImageTagMap> Create(int itemId, ItemTagId itemTagId)
 {
     return(_imageTagMapRepository.Create(new ImageTagMap
     {
         ImageId = itemId,
         ItemTagId = itemTagId,
     }));
 }
Esempio n. 2
0
        public Result Delete(int itemId, ItemTagId imageTagId)
        {
            var itemTagMap = _imageTagMapRepository.GetTagMapsForImage(itemId).FirstOrDefault(itm => itm.ItemTagId == imageTagId);

            if (itemTagMap == null)
            {
                return(Result.Ok());
            }
            return(_imageTagMapRepository.Delete(itemTagMap));
        }
        public List <ImageMetaData> GetImagesWithTag(ItemTagId itemTagId)
        {
            var sqliteConnection = new SQLiteConnection(_configurationAccessor.GetDatabaseConnectionString());

            using (var model = new EntityFramework.Model(sqliteConnection))
            {
                return((from imd in model.ImageMetaDatas
                        join itm in model.ImageTagMaps on imd.Id equals itm.ImageId
                        where itm.ItemTagId == itemTagId
                        select imd).ToList());
            }
        }
Esempio n. 4
0
 public List <ImageMetaData> GetImagesWithTag(ItemTagId itemTagId) => _imageMetaDataRepository.GetImagesWithTag(itemTagId);