C#错误C s1519错误 [英] c# error c s1519error

查看:68
本文介绍了C#错误C s1519错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好, 在下面提到的代码下面我有一个错误-我在此论坛上附上了代码,您也可以告诉我,如何在安装有6.0的c#4.5版本中编写下面的代码.   thw error becoz =>该操作员.请尽快恢复原状.

Hello ,  i have a error below mentioned code  i have attached in this forum also could you tell me ,how do write below code in c# 4.5 version insted of 6.0 .  thw error becoz => this operator.please revert back asap.

public long GetPOCVolume() => ladder.Max(kv => kv.Value);// these lines are gettibg the error previous  I haveposted what ever I have changed it will affected to main file or invalid token classmember ecpected.

        public long GetPOCVolume(TradeSide side) => ladderBidAsk[(int)side].Max(kv => kv.Value);

        public long Volume() => ladder.Sum(kv => kv.Value);

        public bool IsEmpty() => ladder.Count == 0;
 //I got the message like these are the c#6.0 versione it will support
Only in those.
But am using the ninjascript and c# 4.5                                                       I don’t have the visual  studio. 
//is it nessary to run ninjascript in visual studio complusary .if  yes tell me the version I could follow .
//but ninja trder software support only the.net 4.5 versione.
//really am fed up with this error if possible please give me  proper solution => this is lamda operatoris not support in ninja script .
//visual studio 2017 is support for ninja trader8





推荐答案

是编译器所针对的lambda本身,还是它只是方法的语法快捷方式的一部分? IOW,如果您更改以下内容:

Is it the lambda itself that your compiler objects to or is it just the part where it acts as a syntactical shortcut for a method? IOW, if you change these:

public long GetPOCVolume() => ladder.Max(kv => kv.Value);
public long GetPOCVolume(TradeSide side) => ladderBidAsk[(int)side].Max(kv => kv.Value);
public long Volume() => ladder.Sum(kv => kv.Value);
public bool IsEmpty() => ladder.Count == 0;

对此,它将进行编译吗?

to these, will it compile then?

public long GetPOCVolume()
{
    return ladder.Max(kv => kv.Value);
}
public long GetPOCVolume(TradeSide side)
{ 
    return ladderBidAsk[(int)side].Max(kv => kv.Value);
}
public long Volume()
{
    return ladder.Sum(kv => kv.Value);
}
public bool IsEmpty()
{
    return ladder.Count == 0;
}



这篇关于C#错误C s1519错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆