0
在演示WCF,我有一個錯誤時嘗試創造類繼承的IList <>實現接口成員 'System.Collections.IEnumerable.GetEnumerator()'
public class Profileview: IList<Profile>
{
public Profile ViewProfile(int accountID)
{
return this.Where(p => p.AccountId == accountID).First();
}
}
這是服務
namespace DemoService
{
[ServiceContract]
public interface IProfileService
{
[OperationContract]
Profile ViewProfile(int accountID);
}
[DataContract]
public class Profile
{
[DataMember]
public string FirstName { get; set; }
[DataMember]
public string LastName { get; set; }
[DataMember]
public string Location { get; set; }
[DataMember]
public string Genre { get; set; }
[DataMember]
public int AccountId { get; set; }
}
}
錯誤1 'ICService.Profileview' 不實現接口成員 'System.Collections.IEnumerable.GetEnumerator()'
你能告訴我如何解決它。 謝謝:)
謝謝!它的工作:) – 2012-03-28 14:21:16
@CongTran:不客氣。請不要忘記接受我的回答:[如何接受答案?](http://meta.stackexchange.com/questions/5234/how-does-accepting-an-answer-work)。 – 2012-03-28 14:22:06
我做到了;)謝謝:D – 2012-03-28 15:00:48