this operation is not supported in the WCF test cl

2019-09-04 17:34发布

问题:

I am getting the error

this operation is not supported in the wcf test client because it uses type catNameService.catNames[]

Class and IClass code:

catService class:

namespace catNameService
{
    class catService:IcatService
    {
        public IEnumerable<catNames> sortBySex(int genderNumber)
        {
            using (var context = new catNamingEntities())
            {
                return context.catNames.Where(t => t.Gender == genderNumber).ToList();
            }
        }
    }
}

IcatService interface:

namespace catNameService
{
     [ServiceContract]
     public interface IcatService
     {
         [OperationContract]
         IEnumerable<catNames> sortBySex(int genderNumber);
     }
}