0

How can I convert this code LINQ to SQL in C # LINQ to SQL in Vb.net

    public IQueryable<Maestro_Clientes> GetMaestro_Clientes()
    {
        var q = from co in this.Context.Cli_Consumos
            group co by new
            {
                Servicio = co.Servicio,
                Cliente = co.Cli_Servicio.Cli_Cliente.Nombre ,
                Tarifa = co.Cli_Servicio.Cli_Tarifa.Descripcion ,
                Sector = co.Cli_Servicio.Sector,
                Sector_Nombre = co.Cli_Servicio.Cli_Sector.Descripcion 
            }

            into grp
                select new Maestro_Clientes
                {
                    Servicio = grp.Key.Servicio,
                    Nombre = grp.Key.Cliente,
                    Tarifa = grp.Key.Tarifa,
                    Sector = grp.Key.Sector,
                    Sector_Nombre = grp.Key.Sector_Nombre,
                    Consumo_Energia = grp.Sum(co => co.Consumo_Energia)
                };

        return q;
    }

Telerik and Developer Fusion not convert well

1
  • converting with Developer Fusion or Telerik is lost or field list Commented Oct 30, 2009 at 21:33

2 Answers 2

1

Have you tried any of the online converters? i.e. Developer Fusion or Telerik

Sign up to request clarification or add additional context in comments.

1 Comment

I tried both of them, and they both seem to fail when it comes to converting the anonymous type constructs.
0

Try SharpDevelop's CodeConverter. It works best if you give it a whole function or class.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.