Problem with Lambda expression

2 posts, 0 answers
  1. Aaron
    Aaron avatar
    1 posts
    Member since:
    Jan 2013

    Posted 25 Jan 2013 Link to this post

    I wanted to make you aware of a couple of problems with the conversion of the following code to  When converted, this is converting the Lambda expression into a do loop.  Also, the _ in the function declaration was giving me fits trying to figure out what that should be.  I did eventually determine that the _ simply refers to a variable that you don't care what the return value is, and was able to get this converted (finally) with a different code conversion project, but I wanted to make you aware of the issue so that you can have a chance to try to fix the issue.  I have also attached what I hope is the converted form of this function.  Just trying to learn what this project is doing, so I may not be totally correct :)
    public void Install(IWindsorContainer container, IConfigurationStore store)
            .Unless(t => t.IsGenericTypeDefinition)
            .WithService.Select((_, baseTypes) =>
                    from t in baseTypes
                    where t.IsGenericType
                    let td = t.GetGenericTypeDefinition()
                    where td == typeof(IRequestHandler<,>)
                    select t;
    Public Sub Install(container As Castle.Windsor.IWindsorContainer, store As Castle.MicroKernel.SubSystems.Configuration.IConfigurationStore) Implements Castle.MicroKernel.Registration.IWindsorInstaller.Install
        container.Register(AllTypes.FromAssemblyContaining(GetType(EmployeesTask)).BasedOn(GetType(IRequestHandler(Of ,))).Unless(Function(t) t.IsGenericTypeDefinition).WithService.Select(Function(MyType, baseTypes) _
            From t In baseTypes _
            Where t.IsGenericType _
            Let td = t.GetGenericTypeDefinition() _
            Where td Is GetType(IRequestHandler(Of ,)) _
            Select t).LifestyleTransient())
    End Sub
  2. Genady Sergeev
    Genady Sergeev avatar
    1600 posts

    Posted 30 Jan 2013 Link to this post

    Hi Aaron,

    The Telerik converter is not really developed any more. We believe that it it is sufficient stage to handle most of the conversions from and to VB.NET, unfortunately, there are a few places (namely lamba expressions) where it is failing. We are aware of these issues, however, for now we don't have plans to further develop the converter.

    All the best,
    Genady Sergeev
    the Telerik team

    Consider using RadControls for ASP.NET AJAX (built on top of the ASP.NET AJAX framework) as a replacement for the Telerik ASP.NET Classic controls, See the product support lifecycle here.

Back to Top