views:

247

answers:

1

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  A: 

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

Matthew Sposato
I tried both of them, and they both seem to fail when it comes to converting the anonymous type constructs.
Fredrik Mörk