I am trying to understand when to use data contracts. So i have a very simple example to see if i am correct and if not please could someone advise:
I have a movie collection, for simplicity i need to view all movies and related data (director and star) and add directory and star.
Finally i would need to add a movie and other data.
My client would be a Windows Form (VB .Net).
So initially i would have a operation contract which will expose:
Function ViewAllMovies as dataset
Function ViewMoviesByStar (byval Star as string) as dataset
the above code would link to an external dll to call Stored Procedures from a database.
Now i need to insert some data:
InsertDirector (byVal DirectorName as string)
Now if my database has a Directors table with
I could have a Data Contract similar to
Public class Director
Private DirID as Integer
Private DirName as string
Public Property DirectorID as Integer
Public Property DirectorName as String
and then i can map these datamembers to my client to pass these details to the stored procedure to insert into a database.
View Complete Post