﻿using System.Web;
using System.Web.Routing;
using Blog.DataAccess.Interfaces;
using Blog.WebLogApi;
using Microsoft.Practices.ServiceLocation;

namespace Blog.Handlers
{
    public class MetaWebLogApiRouteHandler : IRouteHandler
    {
        public IHttpHandler GetHttpHandler(RequestContext requestContext)
        {
            var unitOfWork = ServiceLocator.Current.GetInstance<IUnitOfWork>();
            var userManager = ServiceLocator.Current.GetInstance<IApplicationUserManager>();
            return new MetaWeblog(unitOfWork, userManager);
        }
    }
}