private IActionResult GetBadRequestResult(IActionExecutingContext context) { if (_hostingEnvironment.IsDevelopment()) { return(new BadRequestObjectResult(context.ModelState)); } return(new BadRequestResult()); }
public static ISpan SetTagReturn(this ISpan span, IActionExecutingContext context, int maxLength, bool isForce = false) { if (!isForce && context.ContractMethod.IsTraceReturnIgnore) { span.SetTag(new StringTag("Result"), "[Ignore]"); return(span); } if (context.ContractMethod.MethodInfo.ReturnType != typeof(void)) { span.SetTag(new StringTag("Result"), context.Result.ToDisplayJson(maxLength)); } return(span); }
public static ISpan SetTagMethodObj(this ISpan span, IActionExecutingContext context, int maxLength, bool isForce = false) { span.SetTag(new StringTag("Name"), context.ContractMethod.MethodInfo.ToFullMethodName()); if (!isForce && context.ContractMethod.IsTracerArgsIgnore) { span.SetTag(new StringTag("Args"), "[Ignore]"); return(span); } if (context.ContractMethod.MethodInfo.GetParameters().Length == 0) { return(span); } var mergeArgTypeObj = context.ContractMethod.CreateMergeArgTypeObj(null, null, 0, context.PureArgs); span.SetTag(new StringTag("Args"), mergeArgTypeObj.ToDisplayJson(maxLength)); return(span); }