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?
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 }
);
}
}
}
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
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.
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?
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.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 } ); } } }
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
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.
is working on a reply...