public Result <ImageTagMap> Create(int itemId, ItemTagId itemTagId) { return(_imageTagMapRepository.Create(new ImageTagMap { ImageId = itemId, ItemTagId = itemTagId, })); }
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()); } }
public List <ImageMetaData> GetImagesWithTag(ItemTagId itemTagId) => _imageMetaDataRepository.GetImagesWithTag(itemTagId);