using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using System.Web.Http.OData.Query;
using DataService.Models;

namespace DataService.Controllers
{
    public class NorthwindController : ApiController
    {
        NorthwindEntities entities = new NorthwindEntities();

        public NorthwindController()
        {
            entities.Configuration.LazyLoadingEnabled = false;
        }

        [Queryable(AllowedQueryOptions=AllowedQueryOptions.Format | AllowedQueryOptions.Top)]
        public IQueryable<Customers> Get()
        {
            return entities.Customers;
        }
    }
}
