Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Athul Ks 7 posts 27 karma points
    Feb 20, 2014 @ 12:06
    Athul Ks
    0

    How to use ASP.NET Web API in Umbraco 4.7 & .NET 4.0

    I need to build a web API on an existing umbraco website. A search on google ended up here.
    http://cultiv.nl/blog/how-to-use-aspnet-web-api-in-umbraco-4-net-40/

    Perhaps the only one blog in entire web, that handle this topic.
    But its a little vague one, Its not easy to understand what blogger actually means. So can any one else show me some other resources where i need to look in to or perhaps explain to me what actually i need to do?

  • Ismail Mayat 4511 posts 10091 karma points MVP 2x admin c-trib
    Feb 20, 2014 @ 12:15
    Ismail Mayat
    0

    Athul,

    Follow any other guides you can find on creating webapi in an ordinary way. The only umbraco bit you need to concentrate on is the register api routes bit in the blog

    using System.Linq;
    

    using System.Web.Routing; using System.Web.Http; using CustomerName.Extensions;

    [assembly: System.Web.PreApplicationStartMethod(typeof(AppStart), "PreStart")] namespace CustomerName.Extensions { public static class AppStart { public static void PreStart() { RouteTable.Routes.MapHttpRoute( name: "DefaultApi", routeTemplate: "api/{controller}/{id}", defaults: new { id = RouteParameter.Optional } ); } } }

  • Athul Ks 7 posts 27 karma points
    Feb 20, 2014 @ 13:13
    Athul Ks
    0

    Ismail, 

    Thanks for the help, But my problem also lies in the same area "register api routes ", I can't understand where or in which file I need to do this?
    Do I need to make it in umbraco website or in  an external project, I am little confuced. Please explain little more 

  • Ismail Mayat 4511 posts 10091 karma points MVP 2x admin c-trib
    Feb 20, 2014 @ 13:23
    Ismail Mayat
    0

    You create a new class and add that code this will run when website runs regardless of whether its umbraco or normal site. In later versions of umbraco there is umbraco webapi controller so some of this is done for you.

Please Sign in or register to post replies

Write your reply to:

Draft