Skip to content

Instantly share code, notes, and snippets.

@sshibani
Last active October 9, 2015 13:51
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
DD4T RestService WebApi
using DD4T.ContentModel.Contracts.Logging;
using System;
using System.Collections.Generic;
using System.Web.Http;
namespace MyDD4T.RestService
{
[RoutePrefix("mycustom")]
public class MyCustomController : ApiController
{
private readonly ILogger _logger;
public MyCustomController(ILogger logger)
{
if (logger == null) throw new ArgumentNullException("logger");
_logger = logger;
}
[HttpGet]
[Route("NewsItems/{publicationId:int}/{taxonomyId:int}/{key}")]
public IHttpActionResult NewsItems(int publicationId, int taxonomyId, string key)
{
var content = new List<string>();
//Write logic to query the Tridion Content Delivery server
return Ok<List<string>>(content);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment