הערה
הגישה לדף זה מחייבת הרשאה. באפשרותך לנסות להיכנס או לשנות מדריכי כתובות.
הגישה לדף זה מחייבת הרשאה. באפשרותך לנסות לשנות מדריכי כתובות.
The range variable 'variable' conflicts with a previous declaration of 'variable'.
The declaration of a range variable, just like every other declaration, must have an identifier which is unique within the variable's declaration space.
To correct this error
- Give the range variable a unique name.
Example
The following code generates CS1931 because the identifier x is used both as a local variable in Main and as the range variable in the query expression:
// cs1931.cs
class Test
{
static void Main()
{
int x = 1;
var y = from x in Enumerable.Range(1, 100) // CS1931
select x;
}
}
See also
שתף איתנו פעולה ב- GitHub
ניתן למצוא את המקור לתוכן זה ב- GitHub, שם ניתן גם ליצור ולסקור בעיות ולמשוך בקשות. לקבלת מידע נוסף, עיין במדריך התורמים שלנו.