/// <summary> /// timeout request /// </summary> /// <param name="context"></param> /// <returns></returns> private async Task ReturnTimeOut(HttpContext context) { BaseResponseResult response = new BaseResponseResult { Code = "408", Message = "Time Out!" }; context.Response.StatusCode = 408; await context.Response.WriteAsync(JsonConvert.SerializeObject(response)); }
/// <summary> /// not authorized request /// </summary> /// <param name="context"></param> /// <returns></returns> private async Task ReturnNoAuthorized(HttpContext context) { BaseResponseResult response = new BaseResponseResult { Code = "401", Message = "You are not authorized!" }; context.Response.StatusCode = 401; await context.Response.WriteAsync(JsonConvert.SerializeObject(response)); }