Search code examples
xmlsilverlightwcf-ria-services

WCF RIA Services for XML data


Can I use WCF RIA Services to query or manipulate XML data file (not relational database) in silverlight application?


Solution

  • RIA assumes CRUD (create, read, update, delete) operations on the client side, but this can map to anything on the server-side (files, SQL, Xml, anything).

    With RIA on the server-side you just create methods that match the required CRUD operation and the calls to those methods are automatic.

    e.g. if you have a type called "Person", then your server-side methods might be called:

    UpdatePerson( Person )
    DeletePerson( Person )
    IQuerable<Person> GetPersons()
    CreatePerson( Person )
    

    Or you can label the methods explicitly with RIA attributes if you do not follow the suggested naming conventions:

    [Delete]
    MakeHimSleepWithTheFishes( Person )