Last active
October 9, 2015 13:51
-
-
Save sshibani/7c4f410edc4107db97ca to your computer and use it in GitHub Desktop.
DD4T RestService WebApi
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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