using Bootstrap.Admin.Models;
using Bootstrap.DataAccess;
using System.Web.Http;
using System.Linq;
namespace Bootstrap.Admin.Controllers
{
///
///
///
public class UsersController : ApiController
{
///
///
///
///
///
[HttpGet]
public QueryData Get([FromUri]QueryUserOption value)
{
return value.RetrieveData();
}
///
///
///
///
///
[HttpGet]
public User Get(int id)
{
return UserHelper.RetrieveUsers().FirstOrDefault(t => t.ID == id);
}
///
///
///
///
[HttpPost]
public bool Post([FromBody]User value)
{
return UserHelper.SaveUser(value);
}
///
///
///
///
[HttpDelete]
public bool Delete([FromBody]string value)
{
return UserHelper.DeleteUser(value);
}
}
}