简体   繁体   English

如何将这段代码 LINQ to SQL in C# LINQ to SQL in Vb.net

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

How can I convert this code LINQ to SQL in C # LINQ to SQL in Vb.net如何将这段代码 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 Telerik 和 Developer Fusion 不能很好地转换

Have you tried any of the online converters?您是否尝试过任何在线转换器? ie Developer Fusion or TelerikDeveloper FusionTelerik

Try SharpDevelop's CodeConverter .试试SharpDevelop 的 CodeConverter It works best if you give it a whole function or class.如果你给它一个完整的函数或类,它效果最好。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM