Loading User Information from Channel 9
Something went wrong getting user information from Channel 9
Loading User Information from MSDN
Something went wrong getting user information from MSDN
Loading Visual Studio Achievements
Something went wrong getting the Visual Studio Achievements
Silverlight TV 26: Exposing SOAP, OData, and JSON Endpoints for RIA Services
Jan 03, 2011 at 4:50 PMShouldn't you just be able to expose the methods via the standard decoration of the method like in a regular WCF service?
For example:
Create contract: IAdventureWorks.cs
[ServiceContract()] public interface IAdventureWorks { [OperationContract()] IQueryable<Product> GetProducts(); [OperationContract()] Product GetProduct(int id); }Implement in your DomainService and decorate method with WebGet(..) : AdventureWorks.cs
[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Required)] public class AdventureWorksService : LinqToEntitiesDomainService<AdventureWorksEntities>, IAdventureWorks { [WebGet(UriTemplate = "Products", ResponseFormat = WebMessageFormat.Xml)] public IQueryable<Product> GetProducts() { return this.ObjectContext.Products; } [WebGet(UriTemplate = "Products?id={0}", ResponseFormat = WebMessageFormat.Xml)] public Product GetProduct(int id) { return this.ObjectContext.Products.Where(p => p.ProductID == id).FirstOrDefault(); } }Add .svc to Web Project : AdventureWorksExtService.svc
Add necessary config settings to web.config.
I realize that is not the case, but would follow the conventions that WCF has establiished outside of RIA. Future addition?