ASP.NET Web API <#= Proxy to T4 #>

One of the coolest new features of ASP.NET is Web API, which allows you to build powerful RESTful services exposed over HTTP. HTTP is not just for serving up web pages, but it provides a platform for building APIs that expose services and data. It is simple, flexible, and ubiquitous.

ASP.NET Web API is all about REST HTTP Services. Unlike Web Services, it does not expose an end-point for meta-data exchange. When consuming a HTTP Service, you will have to create your own client-side code that must serve as a proxy for interfacing with the API.

Like any other WCF junkie out there, I've been working with Windows Communication Foundation for quite some time now implementing Web Services. Not only is it flexible and extensible, but it offers inter-operability, multiple message patterns, transactions and  meta-data exchange etc.

The nice thing about WCF is meta-data exchange, which allows you to generate the client-side proxy-code, contracts and classes used for talking to the service. On the other hand, ASP.NET Web API is more light-weight, operates only via HTTP and is used more for serving CRUD-based operations. The latter, however, does not have functionality (yet) for exposing service meta-data. Until now...

Some API "best suggestions"

In today’s modern world of computing it’s a no-brainer to expose some kind of service for the outside world to access your enterprise platform in a controlled fashion. Because of good old legacy systems, we all know that “the perfect world” never exists in any of our clients’ current environment. There are always compatibility issues regarding unified communication between these systems and we end up building all kinds of middle layers to facilitate this interaction. The latter makes it a nightmare to implement any kind of external service.

By building a platform with a collection of loosely coupled components and exposing specific functionality via an unified interface is much better than having all kinds of silo systems talking to each other. We can achieve this by implementing an API over REST (Representational state transfer).

Train yourself, yourself

Getting skilled up is the only way to stay alive in the IT services business, and the best way to do that is hands-on experience.  But it isn’t always easy to explore a new tech or skill if you are not working on a project that it is being used on, apart from time constraints the hardware and software you need may be lacking. So I decided to post a couple of things I`ve come across to help in this regard. And since I`m a SQL guy, I will focus on SQL type things.

I`m not saying formal, class based or course-type training is useless, it is great to introduce you to a new field and get you going quicker, but to become skilled, it will have to be some dirt under the nails stuff.
 

So let`s start at the beginning.


 

SQL Server Sample Databases:

For almost all of what follows you will need the AdventureWorks set of sample DB`s, download them at:
http://msftdbprodsamples.codeplex.com/ The codeplex site is a great source for Sample databases and source code.

SQL Server Virtual Labs:

http://www.microsoft.com/en-us/sqlserver/learning-center/virtual-labs.aspx

“Virtual Labs enable you to quickly evaluate and test Microsoft's newest products and technologies through a series of guided, hands-on labs that you can complete in 90 minutes or less. There is no complex setup or installation required, and you can use Virtual Labs online immediately, free.” -Microsoft

These labs are really great; each consists of one or more Hyper-V Instances hosted in the cloud that you can work on for 90 minutes. As well as an instructional step by step guide you can follow, or you could just mess around….

Some of the topics that are covered:
·         SQL Server 2008 R2: Database Mirroring
·         SQL Server 2012: AlwaysOn Availability Groups
·         SQL Upgrade: Upgrading to SQL Server 2008 R2
·         Exploring Power View
·         Importing and Developing a BI Semantic Model in Microsoft Visual Studio.
·         SQL Server 2012 - What's new in Manageability

Windows Azure – Free trail:


Need a platform to test or host something you`ve been working on? Microsoft Azure has your back here; they offer a free 90 day trial of their cloud hosting solution. All you need is a credit card to register, and you can have a fresh new SQL instance, web service or even a Windows Server 2012 virtual machine with SQL 2012 running in 15 minutes.  And don’t worry they automatically put a R0.00 limit on your account during the trial period, so you can`t get caught with your pants down.
The free trial includes:

·         compute / 750 small compute hours per month
·         web sites / 10 web sites
·         mobile services / 10 mobile services
·         relational database / 1 SQL database
·         SQL reporting / 100 hours per month
·         storage / 35GB with 50,000,000 storage transactions
·         data transfer / unlimited inbound & 25GB outbound
·         media services encoding / 50 GB (input & output combined)
·         cdn / 20GB outbound with 500,000 transactions
·         cache / 128MB
·         service bus / 1,500 relay hours and 500,000 messages

They have a couple of Hyper-V images you can fire up immediately, or you could upload your own.

I am currently trying to put the Microsoft SQL 2012 BI Demo VM on a bit of a diet, so that I can upload it , host it, and have all the SharePoint-Integrated BI niceties in the cloud. I am still just scouting for an internet connection to abuse…cough cough… I will write a blog post as soon as I`ve got this sorted.
 

Microsoft product samples:

Recently I`ve been longing (weird I know) to go through the whole lifecycle of a business intelligence solution; from dimension modeling to ETL and building cubes and finally onto Reporting and designing dashboards and such.
I came upon Microsoft’s product samples, particularly the SSIS packages and SQL code that builds the Adventure Works Data Warehouse from its namesake OLTP database. This helps me to go through and understand all the steps in detail. This particular one I downloaded from Codeplex;
 
There are many more of these samples covering a host of different topics. They can also be installed from the SQL Server installation media.
 

And last but not least….SQL Server Books Online:

BOL is probably the single most useful resource for SQL Server professionals…..Straight and Simple.
 

 

It Sounds Like...

Imagine a world where everyone had the spelling capability of a High School English teacher... Now snap out of it, because that's slightly delusional. Everybody makes the odd spelling mistake, especially when it comes to names, luckily there's a way in SQL to get around this...

Google Doodles Hacked... Well kind of...

When the Google Doodles were initially released during the Olympics I played every single game up to the point of absolute boredom. Then yesterday I was a bit bored and started going on a random Google spree and came across the games again and once again I decided to play them, then I thought... Why not try to automate this...

How to use CTE's


What is a CTE?

Basically a common table expression is a table that gets created and only lasts for the duration of that query. Once the query is executed, the table doesn't exist anymore. It can be self referenced and can be referenced multiple times in the same query.

Copy and paste programming


Copy and paste programming by Boipelo Rathebe

A couple a of weeks ago I had a very interesting chat with a java software developer friend of mine, who had just recently started the job and us just having a friendly chat around how he’s finding it, and to my surprise, or not, because  I am quite convinced that we all have found ourselves doing “it”. He tells me it is very hectic and this as a result has taken his friendship with google to a whole new level, so basically when he gets stuck he’ll just do an internet search on what he’s struggling with and hopefully get a suitable solution.