.NET 6-0 -new List 'new' expression can be simplified
.NET 6-0 -new List 'new' expression can be simplified
08 Apr 2023, 14:39
I get the 'new' expression can be simplified to the following line of code:
private List<double> myPrices = new List<double>();
It works fine in .NET Framework 4x (Legacy) but I want my code to work in .NET 6.0 as well.
How do I resolve this?
Any help appreciated.
Many thanks.
Replies
ctid5083541
17 Apr 2023, 15:56
RE: RE:
No I don't have Visual Studio but thanks for your reply.
firemyst said:
You don't have to. It can be simplified doesn't mean it has to be simplified.
If you simplify it, the syntax may not be compatible with .net framework 4.x.
If you are using Visual Studio, just hover the issue in the actual code and then in the pop up window select "show potential fixes".
@ctid5083541
firemyst
09 Apr 2023, 07:19
RE:
ctid5083541 said:
You don't have to. It can be simplified doesn't mean it has to be simplified.
If you simplify it, the syntax may not be compatible with .net framework 4.x.
If you are using Visual Studio, just hover the issue in the actual code and then in the pop up window select "show potential fixes".
@firemyst