こんにちは、WCF サービスを使用して DB からデータを取得するアプリに取り組んでいます。しかし、電話で結果を表示したい場合、VSでエラーが表示されます。WCF で MachineEntity から Machine に変換してから、それをクライアント アプリに送信しています。
を参照して、エラーは次のe.Result
とおりです。
タイプ 'WP7App.WCFService.Machine' を 'System.Collections.IEnumerable' に暗黙的に変換することはできません。明示的な変換が存在します (キャストがありませんか?)
public FoundProduct(int s)
{
InitializeComponent();
Service1Client proxy = new Service1Client();
proxy.GetMachineCompleted += new
EventHandler<GetMachineCompletedEventArgs>(proxy_GetMachineCompleted);
proxy.GetMachineAsync(s);
}
void proxy_GetMachineCompleted(object sender, GetMachineCompletedEventArgs e)
{
listBox1.ItemsSource = e.Result;
}