public ContentResult Sql(Context context) { var log = new SysLogModel(context: context); var result = context.Authenticated ? Extended.Sql(context: context) : ApiResults.Unauthorized(context: context); log.Finish(context: context, responseSize: result.Content.Length); return(result); }
public async Task <HttpResponseMessage> Sql() { var body = await Request.Content.ReadAsStringAsync(); var context = new Context( sessionStatus: User?.Identity?.IsAuthenticated == true, sessionData: User?.Identity?.IsAuthenticated == true, apiRequestBody: body); var log = new SysLogModel(context: context); var result = context.Authenticated ? Extended.Sql(context: context) : ApiResults.Unauthorized(context: context); log.Finish(context: context, responseSize: result.Content.Length); return(result.ToHttpResponse(Request)); }