- What's the best way to turn an EF proxy object into the original POCO object?
- // GET api/Clients/5
- public Client GetClient(int id)
- {
- Client client = db.Clients.Find(id);
- if (client == null)
- {
- throw new HttpResponseException(Request.CreateResponse(HttpStatusCode.NotFound));
- }
- return client;
- }
- db.Configuration.ProxyCreationEnabled = false;