Writing a JSON API in ASP.NET MVC 3

Here is a snippet of the source for the current API on Shuttr.

using System;  
using System.Collections.Generic;  
using System.Linq;  
using System.Web;  
using System.Web.Mvc;  
using Shuttr.Domain.Abstract;

namespace Shuttr.Web.Controllers  
{
    /// <summary>
    /// This controller provides our public API.  It can be consumed by mobile or desktop applications.
    /// </summary>
    public class ApiController : Controller
    {
        private IFolderRepository _folderRepository;
        private IPhotoRepository _photoRepository;
        private IPhotographerRepository _photographerRepository;

        /// <summary>
        /// Constructor
        /// </summary>
        public ApiController(IFolderRepository folderRepository, IPhotoRepository photoRepository, IPhotographerRepository photographerRepository)
        {
            _folderRepository = folderRepository;
            _photoRepository = photoRepository;
            _photographerRepository = photographerRepository;
        }

        /// <summary>
        /// Returns the full list of directory photographers.
        /// </summary>
        public JsonResult Photographers()
        {
            return Json(_photographerRepository.DirectoryPhotographers.Select(p => new { Id = p.Id, Name = p.GallerySetting.GalleryName, City = p.DirectorySetting.City, Province = p.DirectorySetting.Province, Sports = p.DirectorySetting.Sports, Weddings = p.DirectorySetting.Weddings}).ToList(), JsonRequestBehavior.AllowGet);
        }
    }
}

The repositories are bound using Ninject so that our code is unit testable. As you can see, the actual call is pretty simple using LINQ, anonymous objects and the new JSON helpers in .Net.