我有以下几点:
Dim Pols As Model.Batches.Renewals.YYYYY() = RenewAnaFindToYYYY(BegDate, EndDate, BegDate2, EndDate2, True)
Pols = Pols.Where(Function(x) x.PolicyId = 1440728).ToArray()
Run Code Online (Sandbox Code Playgroud)
现在如何测试 PolicyID 的列表?我想在数组中包含 PolicyID 的 {1425427, 1440728, 1695324}。我该怎么做呢 ?非常感激任何的帮助。
杰森
我在WebApi项目中使用了logging.cs类来记录有关传入请求的信息。
该类是从Global.asax中的Application_BeginRequest()方法触发的。 我需要在请求中获取Controller名称和Authorization标头。怎么做 ?
我一直在使用HttpRequest Request对象,但是似乎无法充分利用我真正需要的东西。(尽管Http请求的方法似乎很简单!!)
对于Authorization标头,我认为它就像“ Request.Headers [” Authorization“];”一样简单。但是,当前返回为null。
我的代码在下面,任何方向或建议将不胜感激。-杰森
namespace WCAPI.BLL
{
public class logging_2
{
private static HttpRequest Request
{
get { return HttpContext.Current.Request; }
}
private static HttpResponse Response
{
get { return HttpContext.Current.Response; }
}
public static void LogWcapiRequest(BLL.DebugTmr tmr)
{
if (tmr.EventType == DebugTmr.EventTypes.Null) { return; }
try
{
Services.AFSILog log = new Services.AFSILog();
log.Level = Services.LogLevels.Info;
log.SourceSystem = ANACore.AMTConfig.GetConfigurationValue("ConsoleLogSourceSystem");
if (Request.Url.IsLoopback) { log.SourceSystem += "_" + System.Environment.MachineName; }
log.Stamp = DateTime.Now;
log.Message = …Run Code Online (Sandbox Code Playgroud)