Archive for October, 2008

LINQ To SQL – Needs our support.

October 31st, 2008

A While back Ian Cooper blogged about the need for active development of LINQ To SQL, he had this to say

As a community, as people begin to realize the suprising power of LINQ to SQL, I would like to see us dispel many of the myths that seem to have grown up around that product. I would like to see us put pressure on the Data Platform team to provide the support for LINQ to SQL that we want going forward. Community reaction is everything and if the LINQ to SQL community remains silent in the face of the more vocal, but probably less numerous, EF community, we won’t get the product we deserve

David Hayden has made a call to Microsoft to Open Source the development of LINQ to SQL in response to the ADO.NET Teams announcement on the future of the Entity Framework and its forgotten other LINQ To SQL.

The ADO.net team says that they will improve LINQ to SQL based on community feedback then there is please head what David Hayden and Ian Cooper are saying.

Simon Segal has previously made a Save LINQ to SQL badge which apart from bring really cool is apt.

So if you want to keep POCO objects free of the IPOCO interface (at least in V1 of EF), I would ask the Data Dudes to set LINQ To SQL Free as per David Hayden’s Suggestion.

PDC 08 – Day 2

October 30th, 2008

So like me your one of the many that are not at PDC this year, but you still want to know what’s going check out http://notatpdc.com/

Also check out Jim O’Neil’s PDC Day 2 Wrap Up post.  I have been reading been doing my fair share of reading about all the Oslo, Windows 7 , Azure posts, not forgetting the PDC08 video’s on Chanel 9.  My favourite video so far has been The Future of C# by Anders Hejlsberg 

BTW if you cant find the videos for the session Julia Lerman has taken the effort to describe how to best find the PDC 08 sessions videos.

 

Technorati Tags: ,

Silverlight Flickr Image Browser

October 27th, 2008

In my last post about I mentioned creating a simple Flickr Image Browser in Silverlight. Feedback is required please.

Technorati Tags: ,,

Flickrlight – Silverlight 2 compatible Flickr API

October 26th, 2008

In learning Silverlight 2 I needed some self imposed tasks, one such task was to build a simple Flickr image browser, among other things. In doing so as most people would I found a .net Flicker API called FlickrNet. However when you try to add a reference to FlickrNet from my Silverlight 2 project I encountered a few issues with projects not loading. However after some research and hacking I was able to . Converting the project was the easy part but it was going to be just too hard to get the entire library working because of its reliance on a lot of calls to methods that are not available in the Silverlight Core CLR.

Therefore I have had to strip the existing FlickrNet functionality down, I have decided to christen it Flickrlight and now have a simple working demo of the Flickr Browser Application.

Flickrlight Demo

  The code is fairly similar to what FlickrNet, for those of you who are familiar with the existing API.

   1: private void btnGetPhoto_Click(object sender, RoutedEventArgs e)
   2: {
   3:     PhotoSearchOptions pso = new PhotoSearchOptions();
   4:     pso.Tags = feedURL.Text;
   5:     Photo p = new Photo();
   6:     p.ApiKey = ApiKey;
   7:     p.Secret = SharedSecret;
   8:     p.OnResponseCompleted += p_OnResponseCompleted;
   9:     p.BeginPhotosSearch(pso);
  10: }

One of the few changes is that the calls being made are Asynchronous and hence require the subscription to the Completed Event.

   1: private void p_OnResponseCompleted(FlickrResponseRecievedCompleteEventArgs<FlickrBase> e)
   2: {
   3:     Action bindToList = () => imageList.ItemsSource = ((Photos)e.ResultValue).PhotoCollection;
   4:     this.Dispatcher.BeginInvoke(bindToList);
   5: }

 

At this stage all I have done was to begin to move the Search for Photos functionality, however over the next few weeks I will move some more of this functionality across. I will also make Flickrlight available on Codeplex (unless someone tells me otherwise). Seeing as this will be my first foray into the world of open source if anyone has any experience with what I should be doing here, your help will be greatly appreciated.

The Devils work, in SILVERLIGHT

October 25th, 2008

Hopefully that got your attention. But its not really the devils work. Simon has this theory about why video games and how its the devils work an opinion I do not fully share. Everything in moderation I say including moderation. Anyway I digress , The ninemsn crew has posted a fantastic video of the game QUAKE being ported to SILVERLIGHT yes SILVERLIGHT.

QuakeLight Preview Video

Adam Kinney has a interview with the developer Julien Frelat about the process. I hope we get to see more in the near future.

Technorati Tags: ,,

MD5CryptoServiceProvider for Silverlight

October 23rd, 2008

The Silverlight clr does not have a MD5  implementation so your on your own when it comes to “signing” calls to REST based web services, like Flickr. A quick google found a clean implementation written in managed code, targeting the compact framework. The managed MD5CryptoServiceProvider was created by GL Conseil/Flow Group SAS. It is available for download from their website, I have also made MD5CryptoServiceProvider Source file available for here for download.

How To: Convert a normal Class Library Project to a Silverlight 2.0 Class Library Project

October 23rd, 2008

So you want to add a Normal Class Library Project to a Silverlight application, you think to your self how hard could this be despite the Visual Studio Warnings. Well for the most part its fairly simple, however there are a number of problems that I faced when doing exactly that.

Thanks to Neil Mosafi’s post on converting class library project for Silverlight consumption, I found 2 methods of doing the conversion.

1.) Create a NEW Silverlight  Class Library Project and then ADD your EXISTING code files to the project

2.) Hack the csproj file to change its signature (details are courtesy of Neil Mosafi’s post) VS.NET 2008 believes that its a Silverlight Project (don’t forget the changes needs to be made to both the DEBUG as well as RELEASE sections)

Initially I went about making these changes using method 2 however I kept finding a number of issues relating to duplicate references , especially with the HttpWebRequest object and a few other things.

I also needed to change all non generic collections to use their generic equivalents as all non generic collections are not included  in Silverlight 2.0

The Serializable attribute is not part of the coreclr, therefore it has to go, XML Serialization is your friend. Rockford Lhotka has started work on an alternative to the Serializable attribute however its extremely limited at this stage, The Silverlight Serializer may suit your needs so do check it out.

The project I was playing with also used a little bit of XPath Navigation and some other System.XML namespace classes that are not part of the cut down version, so I have to change the code to use Linq to XML

There were a whole bunch of other things that I fixed up and was good to go when I realized that the project changes were not referencing the correct mscorlib and system.xml libraries, however the compiler did not seem to mind to much which baffled me. At this point I decided that the safer way was to go down option 1, simply because I thought it would give a much better jumping off point, lo and behold it has. I am pretty close to having it compile correctly for the Silverlight application which I intend to share.

At the end of this all my advice in converting is to go with method 1, as its just much more fool proof.