public ContentResult Get(Context context, string guid) { var log = new SysLogModel(context: context); var result = context.Authenticated ? BinaryUtilities.ApiDonwload( context: context, guid: guid) : ApiResults.Unauthorized(context: context); log.Finish(context: context, responseSize: result.Content.Length); return(result); }
public async Task <HttpResponseMessage> Get(string guid) { var body = await Request.Content.ReadAsStringAsync(); var context = new Context(apiRequestBody: body); var log = new SysLogModel(context: context); var result = context.Authenticated ? BinaryUtilities.ApiDonwload( context: context, guid: guid) : ApiResults.Unauthorized(context: context); log.Finish( context: context, responseSize: result?.Content.Length ?? 0); return(result.ToHttpResponse(Request)); }