Convert C# lambda to vb.net code

Hi,

Can someone help me to convert the following code from C# to VB.Net?!

var imagesFacade = App.WorkWith().Images();
imagesFacade.ForEach(
        img =>
        {
            ((IContentManager)imagesFacade.GetManager()).RecompileItemUrls(img);
        }
    ).SaveChanges();

Open in new window


Thanks for your help!

Peter
Peter NordbergIT ManagerAsked:
Who is Participating?
 
Rikin ShahMicrosoft Dynamics CRM ConsultantCommented:
Try this-
Dim imagesFacade = App.WorkWith().Images()
imagesFacade.ForEach(Function(img) Do
	DirectCast(imagesFacade.GetManager(), IContentManager).RecompileItemUrls(img)
End Function).SaveChanges()

Open in new window


http://converter.telerik.com/
0
 
Peter NordbergIT ManagerAuthor Commented:
Doesn't work!

Complains and says that the method ForEach is not known. I have imported all the libraries.

Peter
0
 
CodeCruiserCommented:
What is return type of Images()?
0
Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

 
Jaime OlivaresSoftware ArchitectCommented:
are you using System.Linq?
0
 
Peter NordbergIT ManagerAuthor Commented:
Yes, I've imported linq library. If I don't use lambda, how would it look in usual vb.net?
0
 
Peter NordbergIT ManagerAuthor Commented:
Pointed me in the right direction
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.