コード例 #1
0
 public Result <ImageTagMap> Create(int itemId, ItemTagId itemTagId)
 {
     return(_imageTagMapRepository.Create(new ImageTagMap
     {
         ImageId = itemId,
         ItemTagId = itemTagId,
     }));
 }
コード例 #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));
        }
コード例 #3
0
        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());
            }
        }
コード例 #4
0
 public List <ImageMetaData> GetImagesWithTag(ItemTagId itemTagId) => _imageMetaDataRepository.GetImagesWithTag(itemTagId);