tag:blogger.com,1999:blog-8389214606941174691.post7926634907475626659..comments2024-03-23T02:47:30.648-07:00Comments on Tech Talk: Enjoy the WCF Data Services sandwichelLocohttp://www.blogger.com/profile/04685538094487060639noreply@blogger.comBlogger4125tag:blogger.com,1999:blog-8389214606941174691.post-22934324135502997132010-10-06T12:18:20.923-07:002010-10-06T12:18:20.923-07:00Thanks for the great post. What I don't unders...Thanks for the great post. What I don't understand (and I agree with all your concerns) is why Microsoft invests into school-oriented Entity Framework so much without providing anything serious for enterprise levels. I have stuck to Untyped Data Provider scenario backed with SQL however it is extremely difficult to find any meaningful information that is not related to EF or Linq to SQL (i thought it is dead already). Good point for .NET 3.75 indeed. Starting from .NET 3.5 we don't have a complete foundation within the framework. WCF, WWF, WPF always seem to be half-baked or experimental.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8389214606941174691.post-40313130798273596552010-05-14T00:18:25.947-07:002010-05-14T00:18:25.947-07:00IT did not start with relational databases I guess...IT did not start with relational databases I guess. Anyway this number was a rough guess and is in its essence irrelevant for content of the article.elLocohttps://www.blogger.com/profile/04685538094487060639noreply@blogger.comtag:blogger.com,1999:blog-8389214606941174691.post-79659902521827778962010-05-13T21:38:07.329-07:002010-05-13T21:38:07.329-07:00Hey Tech Talk, your just so full of it: "60 y...Hey Tech Talk, your just so full of it: "60 years in IT" - that would be 1950. Hmm, google for "first relational database" shows that the first paper about relational databases was published 1970. At least get your facts straight...Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8389214606941174691.post-20576820780058935802010-02-15T21:34:36.587-08:002010-02-15T21:34:36.587-08:00My name is Phani and I am a part of the WCF Data S...My name is Phani and I am a part of the WCF Data Services team.<br /><br />It's unfortunate that your first attempt at building a Data Service bombed badly .<br />There's a couple of issues with your data model which are causing the issue you see with your classes.<br /><br />In the Data Services runtime , we expose CLR types which we identify as Entity Types based on our convention.<br />We need every entity type to have a key property defined on it .<br />In case of CLR based providers , one would need to annotate the type with the DataServiceKey attribute<br />to identify a property of the type as a key.<br />If we dont find a DataServiceKeyAttribute on the type , we look for a property named ID on the type <br />or a property which is named ID and if we find one , make that the key property.<br /><br /><br />In your cases above , the first scenario failed as we weren't able to find a key property on the type , <br /><br />public class MyClass <br />{ <br />public string Name { get; set;} <br />}<br /><br />The second case failed as we dont support enums yet , <br /><br />public enum myEnum <br />{ <br />one, <br />two <br />} <br /><br /><br />public class MyClass <br />{ <br />public string ID { get; set;} <br />public myEnum MyEnum { get; set;} <br />}<br /><br /><br />The third case failed as you have a relation from MyClass to MyOtherClass and MyOtherClass isnt an entity type,<br />since we couldnt find a key property on MyOtherClass.<br /><br />public class MyOtherClass <br />{ <br />public string Name { get; set;} <br />} <br /><br /><br />public class MyClass <br />{ <br />public string ID { get; set;} <br />public MyOtherClass MyOtherClass { get; set;} <br />} <br /><br />For more details about how we layer the WCF Data Service system to allow for any kind of Data Source , not just the Entity Framework,<br />please read our blog post here : <br /><br />http://blogs.msdn.com/astoriateam/archive/2007/09/27/astoria-data-sources-and-system-layering.aspx<br /><br />Mike from the WCF Data Services team , wrote an excellent primer to WCF Data Services and it can be found here :<br /><br />http://msdn.microsoft.com/en-us/library/cc907912.aspx<br /><br />The section "Creating a data service from any data source" describes about how to write a CLR based data provider <br />to use as an input to a Data Service.<br />Hope this helps.<br />If you run into any further issue, please feel free to email me at : PhaniRaj AT Microsoft DOT COMPhani Rajhttp://blogs.msdn.com/PhaniRajnoreply@blogger.com