AJAX: Pushing down LINQ objects via Web Services

If you use web services to stream data to the client via the ASP.NET AJAX framework, you may experience challenges when you use LINQ to SQL or Entities as your data model.  This is because LINQ objects retain all of their relationships, which the serialization capabilities have trouble serializing entity sets and such.  The workaround to this is to create an anonymous type.

The anonymous type entry works well, as long as the web service method returns an object.  The anonymous type ensures that only serializable types are returned; any relationship properties can also be pushed down which makes it nice.

Published Friday, September 26, 2008 8:05 PM by bmains
Filed under: ,

Comments

No Comments

The leading UI suite for ASP.NET - Telerik radControls
Outstanding performance. Full ASP.NET AJAX support. Nearly codeless development.