?
Solved

Convert C# lambda to vb.net code

Posted on 2012-09-14
6
Medium Priority
?
448 Views
Last Modified: 2012-11-03
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
0
Comment
Question by:peternordberg
6 Comments
 
LVL 20

Accepted Solution

by:
Rikin Shah earned 1500 total points
ID: 38398655
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
 

Author Comment

by:peternordberg
ID: 38398670
Doesn't work!

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

Peter
0
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 38398866
What is return type of Images()?
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 55

Expert Comment

by:Jaime Olivares
ID: 38402595
are you using System.Linq?
0
 

Author Comment

by:peternordberg
ID: 38404435
Yes, I've imported linq library. If I don't use lambda, how would it look in usual vb.net?
0
 

Author Closing Comment

by:peternordberg
ID: 38563198
Pointed me in the right direction
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
In real business world data are crucial and sometimes data are shared among different information systems. Hence, an agreeable file transfer protocol need to be established.
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Suggested Courses
Course of the Month12 days, 17 hours left to enroll

580 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question