BT

OData Scaffolding is Visual Studio 2013

by Jonathan Allen on Nov 11, 2013 |

One of the new features in VS 2013 is OData Scaffolding. Like MVC Scaffolding, this feature is designed as both a training aid and to speed development. However, it requires a bit more setup than the MVC version. To help you out, Kirthi of Microsoft has created a walk-through on OData Scaffolding.

The most important thing to remember after creating a Web API based OData endpoint is to update the WebApiConfig. By convention, the WebApiConfig is a static class with a single method called Register(HttpConfiguration config). Within this method an ODataConventionModelBuilder is used to actually map the model to an EDM Model. This model is then registered as a route.

If the website was originally created without Web API support you will also need to add this line to the Application_Start event:

GlobalConfiguration.Configure(WebApiConfig.Register);

This method is meant to be used to register routes for the OData controllers and is invoked as a callback to GlobalConfiguration.Configure.

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread
Community comments

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Discuss

Educational Content

General Feedback
Bugs
Advertising
Editorial
InfoQ.com and all content copyright © 2006-2014 C4Media Inc. InfoQ.com hosted at Contegix, the best ISP we've ever worked with.
Privacy policy
BT