Telerik blogs

Last month Telerik released its new LINQ implementation and last week we released the new Data Services Wizard for Telerik OpenAccess, which supports both traditional OpenAccess entities and the new LINQ implementation. I will a walk you through the process where you can connect to a database, add a new domain model, wrap it in a new WCF Data Services (Astoria) service, and add a CRUD enabled Silverlight application. All in 30 seconds!

Step 1: Build your Domain Model (20 seconds)

Open Visual Studio 2010 RTM (or 2008) and add a new ASP.NET project. Right click on the project and select Add|New Item and choose Telerk OpenAccess Domain Model from the item template list.

image

The Visual Entity Designer wizard comes up. Select the database server you are using in the first screen (SQL Server, Oracle, SQL Azure, MySQL, etc) and then also build your database connection string.

image

Next select the tables, views, and stored procedures you want to map and click finish.

image

Step 2: Using the Telerik Data Service Wizard to create the service and Silverlight client with CRUD operations (10 Seconds)

Now the easy part. Find the model in your project, it will be by default EntityDiagrams1.rlinq, and right click it to bring up the context menu.

image

Then select Data Services Wizard|Data Services for .NET 3.5 SP1 Version 2 (Astoria)|Add to Project with new SL Client|Your Project Name. This is the “express” version of the Data Services Wizard. From there it is almost on auto-pilot, you just have to confirm adding the Silverlight Application via the standard Silverlight dialog. All you have to do it hit F5 and run the application!

image

The wizard will create the new WCF Data Service (Astoria), add a new Silverlight application, add the service references, and build your standard CRUD forms in Silverlight, one for each entity you expose. While I suspect that you will want to skin the application and add some validation, the wizard is great for doing the plumbing work for all of the CRUD operations-leaving you to worry about the design and the business logic. We are going to add more to this wizard in the future, things like more control over the layout and validation, play around with it and let us know what is important to add!


Bookmark and Share

About the Author

Steve Forte

 sits on the board of several start-ups including Triton Works. Stephen is also the Microsoft Regional Director for the NY Metro region and speaks regularly at industry conferences around the world. He has written several books on application and database development including Programming SQL Server 2008 (MS Press).

Comments

Comments are disabled in preview mode.