הערה
הגישה לדף זה מחייבת הרשאה. באפשרותך לנסות להיכנס או לשנות מדריכי כתובות.
הגישה לדף זה מחייבת הרשאה. באפשרותך לנסות לשנות מדריכי כתובות.
The range variable 'name' has already been declared
The range variable in a query expression is in scope until the query expression terminates. It must therefore have a unique identifier.
To correct this error
- Give a unique name to each range variable that is introduced in a query expression.
Example
The following example generates CS1930 because the identifier num is used for the range variable in the from clause and for the range variable introduced by the let clause.
// cs1930.cs
using System.Linq;
class Program
{
static void Main()
{
int[] nums = { 0, 1, 2, 3, 4, 5 };
var query = from num in nums
let num = 3 // CS1930
select num;
}
}
See also
שתף איתנו פעולה ב- GitHub
ניתן למצוא את המקור לתוכן זה ב- GitHub, שם ניתן גם ליצור ולסקור בעיות ולמשוך בקשות. לקבלת מידע נוסף, עיין במדריך התורמים שלנו.