locked
WCF data service with datasource other than ADO.net entity framework or LINQ to SQL RRS feed

  • Question

  • I have to create wcf data service that allows to expose the datasource as a rest based service and perform the CRUD operation on source as rest based service. Using ASP.net I am hosting the wcf data service. Will consume this wcf data service in WPF Client. The question is I dont want to use ADO.net entity framework or Linq to SQL or custom data Provider. Can I use connection string for the data souce and run the stored procedure?
    Wednesday, March 9, 2011 2:00 PM

Answers

  • Thanks for response you cleared my question. I need to put a thought in writing a custom provider.

    Thanks

    Suneetha

    • Marked as answer by SuneethaISI Wednesday, March 9, 2011 6:26 PM
    Wednesday, March 9, 2011 6:26 PM

All replies

  • Hi,

    WCF Data Services needs an EDM model (that describes the shape of the data exposed). The EDM model can be defined in three ways:

    - Entity Framework (EF)
    - Reflection provider (based on existing CLR classes, LINQ to SQL would use this)
    - Custom provider (your code describes the model to us)

    That is just the metadata, then when actually running the query, the runtime translates the URL query to a LINQ expression. It then needs a LINQ provider to run that expression against. EF has LINQ to EF, LINQ to SQL has well LINQ to SQL, customer provider has a custom LINQ implementation.

    So you could write a custom provider which exposes all of the data based on stored procedures, but you would have to implement a LINQ provider on top of those. I haven't seen anybody do that yet.

    Thanks,


    Vitek Karas [MSFT]
    Wednesday, March 9, 2011 5:02 PM
    Moderator
  • Thanks for response you cleared my question. I need to put a thought in writing a custom provider.

    Thanks

    Suneetha

    • Marked as answer by SuneethaISI Wednesday, March 9, 2011 6:26 PM
    Wednesday, March 9, 2011 6:26 PM