// GET: api/Users/5
[Route("api/v1/users/{id}")]
[ResponseType(typeof(AspNetUsers))]
public async Task<HttpResponseMessage> GetAspNetUsers(string id)
{
AspNetUsers data = await db.AspNetUsers.FindAsync(id);
if (data == null)
{
var httpResponseMessageNotFound = Request.CreateResponse(HttpStatusCode.NotFound);
httpResponseMessageNotFound.Headers.CacheControl = new CacheControlHeaderValue()
{
MaxAge = TimeSpan.FromMinutes(AppGlobal.CacheMaxAge)
};
return httpResponseMessageNotFound;
}
var httpResponseMessage = Request.CreateResponse(HttpStatusCode.OK, data);
httpResponseMessage.Headers.CacheControl = new CacheControlHeaderValue()
{
MaxAge = TimeSpan.FromMinutes(AppGlobal.CacheMaxAge)
};
return httpResponseMessage;
}