using System;
using System.Collections.Generic;
using System.Linq;
using System.Web.Mvc;

namespace KendoDateSample.Models.Repositories
{
    static public class UserTypeRepository
    {
        public static List<SelectListItem> All()
        {
            List<SelectListItem> list = null;

            using (var context = new FPSTestEntities())
            {
                list = (from x in context.UserTypes.AsEnumerable()
                            select new SelectListItem
                            {
                                Text = x.Name,
                                Value = x.Id.ToString()
                            }).OrderBy(x => x.Text).ToList();
            }

            return list;
        }
    }
}