Unable to run service

Dec 10 2012 12:54 PM
Hi,
I am doing Rainer Stropek demo on MVVM: http://www.youtube.com/watch?v=xLLfBU_1jOA
He is using Entity Framework with a WCF Service Application in Visual Studio 2012. However, both his demo and my application are not working. Magically, in his 3rd video, his aplication suddenly work but we will never get to know why. Tried to contact him several time but was unsuccessful.
When I run the service in the WCF test Client, I'm getting the error: "This operation is not supported in the WCF Client because it is using type MVVM_MedicalArchiver.Data.User[]"
MVVM_MedicalArchiverService.svc.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using MVVM_MedicalArchiver.Data;

namespace MVVM_MedicalArchiver.DataService
{
  [ServiceContract] 
  public class MVVM_MedicalArchiverService
  {
  [OperationContract]
  public IEnumerable<User> GetUsers()
  {
  using (var context = new CliniqueEntities())
  {
  var result = context.Users.ToList();
  result.ForEach(e => context.Detach(e));
  return result;
  }
  } 
  }
}

In SQL Server, i have a table Users with idUser, userName and password.
Any idea why this is not working?
ps I could forward you the solution if required.
Thanks a  lot!
Acheo


Answers (2)