Here’s a quick start for checking out astoria. See my blog post “what the heck is astoria” if necessary. 🙂
Note that I had to do this in XP. I’m having a wierd problem in Vista around the ASPNETCompatibilityEnabled setting in web.config. You can follow the discussion of that if you are interested in this forum thread. The thread is accidentally a combination of Kevin Hoffman’s issues with IIS and my issue with Cassini. They don’t seem to be related problems.
1. Start a new web application project (not website) in VS2008.
2. Add an ADO.NET Entity Data Model using the projects Add New Item dialog.
If you haven’t used the wizard before, you can see this blog post.
The basic steps are
- Generate from Database
- SElect a database (same as doing this for other data UIs in Visual Studio)
- Just leave default names for things for this quickstart. (I pointed to Northwind in SQL Server and it defaulted at NorthwindModel and NorthwindEntities, etc)
- Select all database objects (this is the default). This brings in tables, sprocs and views.
- Then finish and you will see the EDMX file in the solution. You can double click on that to see the conceptual model (one of three parts of the model) in the designer. Note that this is just a simple way of getting a model from a database, the most basic type of conceptual model.
Add a Web Data Service.
Add New Item, choose Web Data Service. It’s in the main section (Visual Basic/ C#, not categorized into Data or Web templates) down on the bottom, alphabetical. 🙂
The services code view should open up. Note the TODO for the class. All you need to do is replace the stub [class name]
with the name of your entity wrapper class created in the model. THe model code gens a class file.
You can open up the model in teh designer and then see it’s Namespace and Entity Container Name in the properties.
That’s it! Now you can browse the web service directly (eg. right click on svc file in solution explorer and View in Browser) and start looking at how the data is exposed through the EDM.
My What the Heck is Astoria post walks through some quick query scenarios to give you an idea of what you can do.
This is just the tip of the iceberg of course. See the Astoria Team blog for more info.
Sign up for my newsletter so you don't miss my conference & Pluralsight course announcements!