1
object picture 어떻게 동적 객체의 길이를 얻을 수 있습니까? Ajax 함수에서 객체를 수신했는데 동적 객체의 데이터에서 목록을 작성하려고 시도하지만 whrn이 작동하지 않습니다. matchesData.lenght를 사용했습니다. matchesData
이후동적 객체의 길이
public string updateQueue(dynamic matchesData)
{
MatchesQueues m = new MatchesQueues();
List<MatchesQueues> MQ = new List<MatchesQueues>();
for (int i = 0; i < matchesData.length; i++)
{
MatchesQueues matchqueue = new MatchesQueues(matchesData[i].FieldId, matchesData[i].MatchId, matchesData[i].NumInQueue);
MQ.Add(matchqueue);
}
int rowsAffected = m.updateQueue(MQ);
if (rowsAffected == 1)
{
return "Time Updated";
}
else
{
throw (new Exception("Time didn't updated"));
}
}
같은 속성에 액세스, 그림을 참조하십시오. 그 이유는 처음에는 문자열 목록 대신 동적으로 사용하기로 결정했기 때문입니다. 객체의 그림을 추가했습니다. –
@MosheEzer,'matchesData'의 실제 유형은 무엇입니까? 더 나은 설명을 위해 클래스 정의를 게시 하시겠습니까? 그림이별로 도움이되지 않을 것이다. – Rahul