.NET BC : A Lap around WebMatrix; With a dash of Razor

Tags: .NET, .NET C#, .NET Visual Studio .NET, ASP.NET, C#, Local Community, Razor, Web, Web Development, Web Matrix, WebMatrix

 

Last night most of the DotNetnuke team and I traveled into Burnaby, to the BCIT campus where I gave a real quick (1 hour) presentation on the WebMatrix Beta, and Razor Syntax.

I was happy to see that we had over 60 people attend.  It was awesome to see the turn out on a hot summer evening. 

Download the Slide Deck

There were a number of questions which came up, I will try to remember them all here.

 

Working with Data – the db.Query() execution, can it be parametrized?

@{
var db = Database.OpenFile("SmallBakery.sdf");
var selectQueryString = "SELECT * FROM Products ORDER BY Name";
}
@foreach (var row in db.Query(selectQueryString)){
<tr>
<td>@row.Id</td>
<td>@row.Name</td>
<td>@row.Description</td>
<td>@row.Price</td>
</tr>
}

Yes, you can.  Here is an example.

@{
var db = Database.OpenFile("SmallBakery.sdf");
var Name = Request["Name"];
var Description = Request["Description"];
var Price = Request["Price"];
var insertQuery = "INSERT INTO Products (Name, Description, Price) VALUES (@0, @1, @2)";
db.Execute(insertQuery, Name, Description, Price);
}

What and Who is WebMatrix and Razor targeted to?

Essentially the breadth developer.  Those folks that possibly come from a PHP background or even are new to the development world.  This will allow for them to onboard with a few minor tweaks to existing projects to get up and running as fast as possible.

 

Why is Web Matrix even needed when we have Visual Studio?

The initial thoughts are that this product is going to be free.  It will have a bare minimum feature set targeted to the scripter.  The UI is far simpler than what VS.NET Users are used to.  You could consider it as a a stepping stone into VS.NET.

 

There was some discussion around Razor Syntax and MVC.  Using it as a view engine.  Here are some resources to help with this answer.

http://gurustop.net/blog/2010/07/06/thoughts-on-razor-microsofts-new-asp-net-mvc-view-engine/

and

http://www.dotnetcurry.com/ShowArticle.aspx?ID=561

The topic of LightSwitch came up as well.  Here is the product page

http://www.microsoft.com/visualstudio/en-us/lightswitch

SIMPLEST WAY TO BUILD BUSINESS APPLICATIONS FOR THE DESKTOP, WEB AND CLOUD

Microsoft Visual Studio LightSwitch gives you a simpler and faster way to create professional-quality business applications for the desktop, the web, and the cloud. LightSwitch is a new addition to the Visual Studio family. Visit this page often to learn more about this exciting product.

 

Conclusion

All in all I felt the talk went well.  As usual I went a mile a minute and really tried to slow things down near the end.  Luckily there were enough questions to push us for the full hour.  If you attended feel free to send me feedback and ask questions.  I will do my best to get you the answers – just keep them on topic!

 

 

Resources for the discussion

http://www.asp.net/webmatrix

http://netbc.ca/DNCal/EventDetail.aspx?date=2010/08/24

1 Comment

  • kashyapa said

    Hi Rob, Nice post. Quick question - can i re use your slide deck for one of my presentations. I am giving a talk on Web Matrix in one of the local UG meets. regards Lohith @kashyapa

Comments have been disabled for this content.