locked
How Is IUpdatable Used? RRS feed

  • Question

  • Hi,

    I am taking advantage of Astoria's provider model support and writing my own DataContext and entity classes (Customers, Orders, etc).

    I am trying to implement IUpdatable on my DataContext (similar to what Mike did at his blog: http://mtaulty.com/CommunityServer/blogs/mike_taultys_blog/archive/2007/12/19/10031.aspx)

    Mike used System.Data.Services.Client to create a client application to test his IUpdatable implementation.

    Besides using a client app, is there any other way to test my IUpdatable implementation (i.e. aside from DataServiceContext, is IUpdatable consumed by anyone else)?

    Many thanks in advance.

    exx
    Thursday, June 5, 2008 6:47 AM

Answers

  • Hi exx,

     

    Please refer here for the latest example of using the IUpdatable interface..

     

    http://blogs.msdn.com/astoriateam/archive/2008/04/10/iupdatable-ado-net-data-services-framework.aspx

     

    Regarding testing your Iupdatable implementation , you would have to consider the following factors.

    1) What kind of relations is your IUpdatable Implementation going to support ?

    2) What is the Entity store for your DataService ?

     

    Apart from the client library , you can use the HTTP protocol to interact with the DataService.

    Fiddler is a good Http Client to try out payloads.

    Thursday, June 5, 2008 7:02 PM
    Moderator
  • Hi exx,

     

     You should use SetReference as this operation represents binding an Order to a Customer.

     Depend on SetValue to set properties on your Customer object which are not complex types,  i.e only primitive types.

     

    Thursday, June 5, 2008 7:31 PM
    Moderator

All replies

  • Hi exx,

     

    Please refer here for the latest example of using the IUpdatable interface..

     

    http://blogs.msdn.com/astoriateam/archive/2008/04/10/iupdatable-ado-net-data-services-framework.aspx

     

    Regarding testing your Iupdatable implementation , you would have to consider the following factors.

    1) What kind of relations is your IUpdatable Implementation going to support ?

    2) What is the Entity store for your DataService ?

     

    Apart from the client library , you can use the HTTP protocol to interact with the DataService.

    Fiddler is a good Http Client to try out payloads.

    Thursday, June 5, 2008 7:02 PM
    Moderator
  • Thanks for your reply Phani.

    My entities are just in-memory data structures. I would model a 1:1 relationship via a simple Customer -> Order structure, and a 1:n relationship via Customer -> IList<Order>. Would that work?

    Have some questions regarding relationships. From the IUpdatable documentation, it mentions that SetValue is used for primitive and complex types, whereas SetReference is used to set 1:1 relationships. Suppose I have a Customer class with a property of type Order. This represents a 1:1 relationship between a Customer and an Order. If I want to set that Order property, do I use SetValue (since Order is a complex type) or SetReference (since Order represents a 1:1 relationship)?

    Thanks!
    exx




    Thursday, June 5, 2008 7:12 PM
  • Hi exx,

     

     You should use SetReference as this operation represents binding an Order to a Customer.

     Depend on SetValue to set properties on your Customer object which are not complex types,  i.e only primitive types.

     

    Thursday, June 5, 2008 7:31 PM
    Moderator
  • Got it! Thanks!

    Thursday, June 5, 2008 7:35 PM