static ImageProperties summonImage(Assembly assembly, string name, IImageRepository imageRepository) { if (!imageRepository.ContainsImage(name)) { var imageLoader = ObjectFactory.GetInstance <ILoadImages>( ); imageRepository.Set(new ImageProperties( name, imageLoader.LoadFromResource(assembly, name))); } return(imageRepository.GetByName(name)); }
static ImageProperties summonImage(Assembly assembly, string name, IImageRepository imageRepository ) { if( !imageRepository.ContainsImage( name ) ) { var imageLoader = ObjectFactory.GetInstance<ILoadImages>( ) ; imageRepository.Set(new ImageProperties( name, imageLoader.LoadFromResource( assembly, name ) ) ) ; } return imageRepository.GetByName( name ) ; }
public async Task <bool> IsValidGetImageNews(IImageRepository repository, string city, DateTime date, Guid id) { return(await repository.ContainsImage(city, date, id)); }