public static void SetApiRequestConfig(this HttpContext context, bool logEnabled, bool allowPartialResponse, string controller, string action) { var feature = context.Features.Get <ApiManagerConfig>(); if (feature == null) { feature = new ApiManagerConfig(); context.Features.Set(feature); } feature.AllowPartialResponse = allowPartialResponse; feature.LogEnabled = logEnabled; feature.Controller = controller; feature.Action = action; }
internal static bool IsAllowPartialResponseEnabled(this HttpContext context, out ApiManagerConfig feature) { feature = context.Features.Get <ApiManagerConfig>(); return(feature != null && feature.AllowPartialResponse); }
internal static bool IsLogEnabled(this HttpContext context, out ApiManagerConfig feature) { feature = context.Features.Get <ApiManagerConfig>(); return(feature != null && feature.LogEnabled); }
internal static string GetAction(this HttpContext context, out ApiManagerConfig feature) { feature = context.Features.Get <ApiManagerConfig>(); return(feature?.Action ?? ""); }
internal static string GetController(this HttpContext context, out ApiManagerConfig feature) { feature = context.Features.Get <ApiManagerConfig>(); return(feature?.Controller ?? ""); }
public static void SetApiRequestConfig(this HttpContext context, ApiManagerConfig config) { context.SetApiRequestConfig(config.LogEnabled, config.AllowPartialResponse, config.Controller, config.Action); }