Avvenimenti
Mar 17, 11 PM - Mar 21, 11 PM
Ingħaqad mas-serje meetup biex tibni soluzzjonijiet skalabbli tal-IA bbażati fuq każijiet ta 'użu fid-dinja reali ma' żviluppaturi u esperti sħabi.
Irreġistra issaDan il-brawżer m'għadux appoġġjat.
Aġġorna għal Microsoft Edge biex tieħu vantaġġ mill-aħħar karatteristiċi, aġġornamenti tas-sigurtà, u appoġġ tekniku.
params
modifier on method parametersThere are a few errors related to the lock
statement and thread synchronization:
System.ParamArrayAttribute
or System.ParamArrayAttribute
/System.Runtime.CompilerServices.ParamCollectionAttribute
. Use the params
keyword instead.params
parameter or neither may use a params
parameterthis
modifier on an extension method.ref
or out
params
is not valid in this contextAdd
method.The following errors indicate using a params
modifier on a parameter when the params
modifier isn't allowed in that context:
this
modifier on an extension method.ref
or out
params
is not valid in this contextThe compiler enforces the following rules on your use of the params
modifier on a method parameter:
params
modifier is allowed only on the last parameter in a formal parameter list. This includes any parameters with a default value.params
modifier is used.params
modifier can't be applied to reference parameter. A reference parameter is one with the in
, ref readonly
, ref
or out
modifier.params
modifier can't be combined with the this
modifier on an extension method.params
modifier can't be used on an overloaded operator.In versions before C# 12, the params
modifier can't be used on the parameter of an anonymous method or lambda expression.
The following errors indicate that the type of the parameter used with params
is invalid:
Add
method.In versions before C# 13, the params
modifier is allowed on single-dimensional arrays only. No other types were valid.
Starting with C# 13 any valid collection type can be used. However, some restrictions remain. The collection type must follow the same rules as the target of a collection expression.
The following errors indicate other issues with using the params
modifier:
System.ParamArrayAttribute
or System.Runtime.CompilerServices.ParamCollectionAttribute
. Use the params
keyword instead.params
parameter or neither may use a params
parameterA method that implements an interface must include the params
modifier if and only if the interface member has the params
modifier. Similarly, either both declarations of a partial
method must include the params
modifier, or none can include the params
modifier.
You must use the params
modifier. You can't apply the equivalent attributes, either System.ParamArrayAttribute or System.Runtime.CompilerServices.ParamCollectionAttribute.
The compiler generates one of the final three errors in the preceding list when the code generated to create the collection type is invalid:
Add
method takes a params
collection of the same type.Create
method for the collection type is less accessible than the method that takes the params
parameter of the collection type.params
modifier without type information on a lambda expression. You must specify the types for all lambda expression parameters to use the params
modifier.Feedback ta’ .NET
.NET huwa proġett b’sors miftuħ. Agħżel link biex tipprovdi l-feedback:
Avvenimenti
Mar 17, 11 PM - Mar 21, 11 PM
Ingħaqad mas-serje meetup biex tibni soluzzjonijiet skalabbli tal-IA bbażati fuq każijiet ta 'użu fid-dinja reali ma' żviluppaturi u esperti sħabi.
Irreġistra issa