﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using TallyBook_BLL.Security;

namespace TallyBook_API.Controllers
{
    public class UserController : ApiController
    {
        // GET api/values
        //public IEnumerable<string> Get()
        //{
        //    return new string[] { "value1", "value2" };
        //}

        //// GET api/values/5
        //public string Get(int id)
        //{
        //    return "value";
        //}
        //Get api/GetUser/account
        public UserEntity GetUser(string account)
        {
            UserEntity user= UserInfo.Find(account);
            if(user==null)
            {
                throw new HttpResponseException(HttpStatusCode.NotFound);
            }
            return user;
        }
        
    }
}
