친구의 코드가 있는데 창문에서 잘 작동합니다. 양식 응용 프로그램. Xamarin.Forms 프로젝트에서 동일한 코드를 사용하려고하면 다음과 같이 표시됩니다.목록 (T) .ForEach가 Xamarin을 사용하여 정의되지 않았습니다.
System.Collections.Generic.List> 'ForEach'에 대한 정의가 없습니다. [...] (어쩌면 "을 사용하여"없는)
는 내가 가진) (독일어 번역) :
public Company GetCompanyById(int companyId) {
Company company = new Company();
allContinents
.MyContinents
.Select(x => x.Countries)
.ToList()
.ForEach(countryList => {
countryList.ForEach(country => {
country.Cities.ForEach(city => {
city.Companies.ForEach(com => {
if (com.Id.Equals(companyId))
company = com;
});
});
});
});
return company;
}
: 여기
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
using Xamarin.Forms;
using System.Reflection;
오류를주는 코드입니다 windows.forms 앱에서와 같이 작동하지 않는 이유는 무엇입니까? 추신 : 그것은 파란색
덕분에 당신은 .NET의 휴대용 클래스 라이브러리 집합을 사용하고
프레임 워크 버전을 정의 할 수 있습니다를 수행하는거야? –
모든 것이 최신입니다. - .NET 4.5 - Visual Studio 2013 Ultimate 및 Xamarin.iOs 및 Xamarin.Android 및 Xamarin.Forms NuGet이 – Hendrik