Silverlight + nHibernate + WCF

I will probably be putting off the elevator application for a while (I hope not indefinitely, I really do enjoy AI). But, I was only doing it to kill time while SQLite got their act sorted out with .Net 4 and I have now officially worked around it. I was only planning on going as far as using WPF for Veronica's next version of the application, but as it turns out, I was able to make Silverlight work with my objects this time.

As my prior post stated, I was able to write an application to copy the old SQLite database into a new SQLServer one. Once I had that down I had to see how well Fluent nHibernate would work with .Net 4. I thought I remembered doing it before with SQLite being the only hitch. Whether or not what I remembered was true, this turned out to be the case. So the next task was to go one step further than I went the last time and to hook everything up to a WCF client and verify that I could make a WPF application communicate properly with the service. This was trivial enough.

Then the final step was to see if I could, using the asynchronous client get Silverlight to use my classes. In the past, any interaction I tried between my domain objects and Silverlight resulted in an explosion at compile time. This time it worked like a charm. Last time I tried Silverlight was long before I had any experience so no ideas what I did wrong, but the nice thing is knowing that I can start this thing now.

I'm kind of sad to see that I can't get SQLite into the mix of technologies I had wanted to use, but everything else is in place and SQLServer Express is free, so everything I'm doing remains free on some level at least. Also, I think if I'm going to potentially start building applications for use in the real world that SQL Server is a more reasonable database. The biggest problem I had with the templated projects was just getting to find and access a flat file database, so this should simplify deployments.

And, while I know this doesn't look like much here is the end result of the simple test page I made to verify the Silverlight communication. I had 2 tests, one that created a new object (the last on in the list below) and a second call that returned a list of all of the entries in one of the tables and bound them to a DataGrid.


Note: Looking at this now however, I think that there was an issue with my application to convert the data... All of the entries in this table has the same GUID except the one I just created. Well, doesn't make me any less happy, just means I need to go back to the drawing board for at least this one table. Many of my other tables worked fine... kind of perplexing actually.

Comments

Popular Posts