1 day and 22 hours ago
in reply to
Daniel Plomp said:Hi Robert,
Arno is given the correct solutions. This is a VB.NET thing. While C# allows the comparing of LString with string directly, in VB.NET you have to explicitly complare the Value property of the LString type with the parameter. But that isn't enough apparently.
It's apparently not just a VB.NET thing - I'm trying to do the same sort of thing in C#, and having no luck.
I try Title=="name", I get an error about comparing LString to String.
I try Title.Value=="name", I get an error about String not having a Value method.
I try Title.Equals("name"), I get no match (even though there is an album with that name).
I've also tried both GetAlbums().Where(...).FirstOrDefault() and GetAlbums().FirstOrDefault(...) - no difference.
Here's the current version of my function:
protected bool ImageExists(string imageName)
LibrariesManager librariesManager = LibrariesManager.GetManager();
Album album = librariesManager.GetAlbums().FirstOrDefault(a => a.Title.Equals("Banners"));
Image image = null;
if (album != null)
image = album.Images().FirstOrDefault(i => i.Title.Equals(imageName));
return (image != null);