public static HttpResponse TeapotResult(ApiOffence offense, string propertName) { var res = new HttpResponse(); res.Content = getContent(offense, propertName); res.StatusCode = 418; return(res); }
private static byte[] getContent(ApiOffence offense, string propertName) { var obj = new Dictionary <string, object>() { [propertName] = new { ErrorCode = offense.ErrorCode } }; return(UTF8Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(obj))); }