tag:blogger.com,1999:blog-25545748.post211412300822355415..comments2023-10-06T06:22:16.978-04:00Comments on Mostafa's Blog: DataContract Vs. Service ContractAnonymoushttp://www.blogger.com/profile/04369573110626236922noreply@blogger.comBlogger5125tag:blogger.com,1999:blog-25545748.post-18143534948525088592009-09-09T04:55:49.273-04:002009-09-09T04:55:49.273-04:00Data Contract only contains data that needs to be ...Data Contract only contains data that needs to be transmitted over.<br /><br />Service Contract contains the methods that will exposed by the service.Anonymoushttps://www.blogger.com/profile/04369573110626236922noreply@blogger.comtag:blogger.com,1999:blog-25545748.post-3217871366045450362009-09-09T02:33:14.998-04:002009-09-09T02:33:14.998-04:00Question: Does datacontract have public method whi...Question: Does datacontract have public method which can be exposed to service.kunalhttps://www.blogger.com/profile/08148204133816588642noreply@blogger.comtag:blogger.com,1999:blog-25545748.post-13809201416466026302008-07-24T15:12:00.000-04:002008-07-24T15:12:00.000-04:00Here's a beginners question:How would I consume (d...Here's a beginners question:<BR/><BR/>How would I consume (display) the DataContract in say a aspx form?<BR/><BR/>thxAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-25545748.post-28204418295732609532007-08-30T03:50:00.000-04:002007-08-30T03:50:00.000-04:00Hi Sebestian,thanks for your question,you can writ...Hi Sebestian,<BR/><BR/>thanks for your question,you can write the DataContract Class on the same file along with your ServiceContract.<BR/><BR/>C# Code :<BR/>[DataContract(Name = "Customer", Namespace = "http://www.contoso.com")]<BR/> class Person : IExtensibleDataObject<BR/> {<BR/> // To implement the IExtensibleDataObject interface, you must also<BR/> // implement the ExtensionData property.<BR/> private ExtensionDataObject extensionDataObjectValue;<BR/> public ExtensionDataObject ExtensionData<BR/> {<BR/> get<BR/> {<BR/> return extensionDataObjectValue;<BR/> }<BR/> set<BR/> {<BR/> extensionDataObjectValue = value;<BR/> }<BR/> }<BR/><BR/> [DataMember(Name = "CustName")]<BR/> internal string Name;<BR/><BR/> [DataMember(Name = "CustID")]<BR/> internal int ID;<BR/><BR/> public Person(string newName, int newID)<BR/> {<BR/> Name = newName;<BR/> ID = newID;<BR/> }<BR/><BR/> }Anonymoushttps://www.blogger.com/profile/04369573110626236922noreply@blogger.comtag:blogger.com,1999:blog-25545748.post-25771021175624661802007-08-28T11:52:00.000-04:002007-08-28T11:52:00.000-04:00Hey dude! I Googled for DataContract vs. ServiceCo...Hey dude! I Googled for DataContract vs. ServiceContract and this post came up first. I read it but you didn't post an example of a DataContract. I understand that the interface must be set as ServiceContract, but where in my code I need to write the DataContract signature?Sebastián Gómezhttps://www.blogger.com/profile/07542900638025481334noreply@blogger.com